You can enable notifications at the creation of new API versions in order to notify existing subscribers (via email) that a new version of the API is available. If you want to send a different type of notification, you can extend the
org.wso2.carbon.apimgt.impl.notification.Notifier abstract class on your own accordingly.
Follow the instructions below to enable notifications for new API versions:
Set the email server configurations in the
repository/conf/output-event-adapters.xmlfile under the
The email address you use to send emails
The email address used to authenticate the mail server. This can be same as
Password used to authenticate the mail server.
- Log in to the Management Console and click Main > Resource > Browse.
- Browse to the
tenant-conf.jsonfile and click Edit as Text.
NotificationsEnabledproperty to true as shown below:
A notification type can have multiple notifier classes that help send multiple notifications. In this case, notification sends via EMail but it could be SMS notification. Each notifier has a class attribute containing the full class path. The following properties should be set for the default
Property Description Class The full class path of the notifier class. ClaimsRetrieverImplClass
Subscriber email addresses are extracted from user claims. The default pack uses the
org.wso2.carbon.apimgt.impl.token.DefaultClaimsRetrieverclass to read the claim values from the user store.
A claim is a piece of information about a particular subject. It can be anything that the subject is owned by or associated with, such as name, group, preferences, etc. For information on how to add new claim mappings, see Configuring Cliams
Title The subject of the email. Template The template of the email body. This can be string values or a valid registry path to a template file.
The following strings are replaced with API specific values in the
$1 - API name
$2 - New API version
If you create the subscriber in the Management Console, you need to add the subscriber's email in the subscriber user profile. You can find the user profile when you list the users in the management console.
If you are using a Google mail account, note that Google has restricted third-party apps and less secure apps from sending emails by default. Therefore, you need to configure your account to disable this restriction. For more information about Setting Gmail, see Creating Users Using the Ask Password Option.