Configuring notifications

Specify the sender name and email address to use for email notifications. You can preview the templates and customize the text if required. You can also style the notifications to match your business theme.

About this task

The API Manager emails are sent automatically when certain system events occur. The email templates are organized by scope, as explained in Table 1.
Table 1. Notification scopes
Scope Events that trigger the notification
catalog Activities related to Catalogs; such as application life cycle events, invitations to catalogs, product approvals, and subscription approvals.
consumer Activities to consumer applications and subscription requests in the Developer Portal, invitations to Consumer organizations, and password reset requests for Developer Portal accounts.
provider Invitations.
space Invitations.

Email notifications contain a sender name and address that's based on a hierarchical search of the configured sender details in API Connect. Depending on the email template being sent, the search can start at the Space level, and then go through the Catalog, Provider Organization, and the Cloud Manager levels. The sender details that are used will be the first set of configured details found during this hierarchical search. To view which search path API Connect takes when looking for the sender details for each notification template, see Configuring sender details for email notifications.

One of the following roles is required to configure email notifications:

  • Administrator
  • Owner
  • A custom role with the Settings:Manage permission
Note: You can also customize notifications by using the developer toolkit CLI, or by using the API Connect REST APIs. See API development and management commands, or API Connect REST APIs, for more information.

Procedure

  1. In API Manager, click Settings Settings.
  2. In the Settings navigation list, click Notifications, then click Edit.
  3. Specify a sender by entering a Name and Email address, then click Save.
    To configure sender details at the Space or Catalog levels, you must use the developer toolkit CLI. For more information, see Configuring sender details for email notifications.
  4. Optional: To enable template customization, move the Customize notification templates slider to the On position.
    Note: You can reload all the default notifications, as configured by a cloud administrator, by disabling and re-enabling template customization. However, doing so will overwrite any customizations that have been made.
  5. To preview the text for a template, select Preview from the options menu Options menu icon alongside the template name.
  6. To edit the text for the template, either click the template name, or select Edit in the options menu alongside the template name.

    When a template is opened, an attempt is made to get the language from the browser setting, but if this isn't possible the template defaults to English.

    The text includes variables; for example, {{catalog}}. The notification text is based on Handlebars syntax. Most variables are enclosed in double curly braces {{ }}, but can be enclosed in triple curly braces {{{ }}} to disable HTML escaping, when the variable is a URL link for example. For more information on Handlebars, see https://handlebarsjs.com/.

    To obtain the complete list of variables that are available for a particular notification template, complete the following steps:
    1. Log in to the management server from the command line as a member of a provider organization; for details, see Logging in to a management server. You can use the same management server URL, user name, and password in the login command that you use to log in to the API Manager user interface.
    2. Enter the following command:
      apic notification-templates:get template_name --server mgmt_endpoint_url --scope org --org provider_organization --subcollection template_scope --fields variables --output -
      where:
      • template_name is the name of the required notification template, as displayed in the Template column in the user interface.
      • template_scope is the scope name displayed in the Scope column alongside that template.
      • provider_organization is the value of the name field for your provider organization.
      For example:
      apic notification-templates:get member-invitation --server https://myserver.com --scope org --org myorg --subcollection catalog --fields variables --output -
      The variables that are available for the template are displayed, for example:
      variables:
        - org
        - catalog
        - activationLink
        - expiresAt
        - originator
        - originatorFirstName
        - originatorLastName
        - originatorEmail
        - username
        - email
        - firstName
        - lastName

      The --output - parameter causes the command output to be written to the command line. You can specify --output filepath to have the output written to a .yaml file at the specified location, or omit it altogether to have a file written to the current folder.

  7. To view and edit the notification template in a different language, select one of the following supported languages from the View template in drop-down list:
    • Chinese (Simplified)
    • Chinese (Traditional)
    • Czech
    • Dutch
    • English (US English)
    • French
    • German
    • Italian
    • Japanese
    • Korean
    • Polish
    • Portuguese
    • Russian
    • Spanish
    • Turkish
  8. Edit the Subject as required.
  9. Select the Content type that you want to use for the template, from HTML, PlainText, or Both. The default content type is PlainText.
    An edit window for the selected content type is displayed, or both edit windows are displayed if Both is selected.
  10. Edit the body of the template as required.
    For HTML content, only the tags and their attributes that are shown in the following table are allowed.
    Table 2. List of allowed HTML tags and their attributes
    HTML tag Attribute
    <a> "class", "href", "hreflang", "style"
    <em> "class", "style"
    <strong> "class", "style"
    <cite> "class", "style"
    <blockquote> "class", "cite", "style"
    <code> "class", "style"
    <ul> "class", "type", "style"
    <ol> "class", "start", "type", "style"
    <li> "class", "style"
    <dl> "class", "style"
    <dt> "class", "style"
    <dd> "class", "style"
    <h1> "class", "id", "style"
    <h2> "class", "id", "style"
    <h3> "class", "id", "style"
    <h4> "class", "id", "style"
    <h5> "class", "id", "style"
    <h6> "class", "id", "style"
    <p> "class", "style"
    <div> "class", "style"
    <br> "class", "style"
    <span> "class", "style"
    <img> "class", "src", "alt", "data-entity-type", "data-entity-uuid", "data-align", "data-caption", "width", "height", "style"
    <table> "class", "id", "style"
    <tr> "class", "id", "style"
    <td> "class", "id", "style"
    If an HTML tag that is not allowed is used in a notification, the tag and its contents are displayed in the email as plain text.

    Images can be used by adding a <img src="https://path/to/image.png"/> tag in the template. The src attribute for the image must be a fully qualified web URL, and must be externally accessible so that the email recipients can access the image. It's not possible to reference local images, they must be fully qualified URLs. It's also not possible to embed or attach images or other files in the emails.

  11. Click Save when done.
    Note: Edits made to a template are saved only for the specific language version that is edited.