Sending Tenant-Wise Emails

This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Sending Tenant-Wise Emails

This feature enables sending emails to users of a particular tenant in scenarios such as Username Recovery, Password Recovery, Creating Users Using the Ask Password Option, and Sending mail OTP. 

To configure this, apply the 5517 WUM update to WSO2 Identity Server 5.7.0 using the WSO2 Update Manager (WUM). 

To deploy a WUM update into production, you need to have a paid subscription. If you do not have a paid subscription, you can use this feature with the next version of WSO2 Identity Server when it is released. For more information on updating WSO2 Identity Server using WUM, see Getting Started with WUM in the WSO2 Administration Guide.

To learn how to create a tenant, see Creating and Managing Tenants.

Follow the steps below to add the configurations pertaining to the SMTP server that will be sending the emails:

  1. Open the EmailPublisher.xml file in the <IS_HOME>/repository/tenants/<TENANT_ID>/eventpublishers directory.

  2. Set the following configurations under the <to eventAdapterType="email"> tag.  

    Element

    Description

    Element

    Description

    mail.smtp.host

    This is the hostname of the SMTP server.

    mail.smtp.password

    This is the password of the sender SMTP server.

    mail.smtp.from

    This is the email address of the sender SMTP server.

    mail.smtp.user

    This is the default user name of the email sender SMTP server.

    mail.smtp.port

    This is the port of the SMTP server.

    mail.smtp.auth

    This is the password hashing method that is used when storing user entries in the user store.

    mail.smtp.starttls.enable

    This enables STARTTLS support for JavaMail API.

    mail.smtp.signature

    This is the email signature.

    mail.smtp.replyTo

    This is the email to which the email recipient can reply to.

    The mail.smtp.signature and mail.smtp.replyTo elements will be considered only if they are available in the output-event-adapters.xml file in the <IS_Home>/repository/conf directory.

    Example

    <?xml version="1.0" encoding="UTF-8"?> <eventPublisher xmlns="http://wso2.org/carbon/eventpublisher" name="EmailPublisher" processing="enable" statistics="disable" trace="disable"> <from streamName="id_gov_notify_stream" version="1.0.0" /> <mapping customMapping="enable" type="text"> <inline>{{body}}{{footer}}</inline></mapping> <to eventAdapterType="email"> <property name="email.subject">{{subject}}</property> <property name="email.address">{{send-to}}</property> <property name="email.type">{{content-type}}</property> <property name="mail.smtp.from">wso2iamtest@gmail.com</property> <property name="mail.smtp.host">smtp.gmail.com</property> <property name="mail.smtp.port">587</property> <property name="mail.smtp.user">wso2iamtest</property> <property name="mail.smtp.password">Wso2@iam70</property> <property name="mail.smtp.auth">true</property> <property name="mail.smtp.starttls.enable">true</property> <property key="mail.smtp.replyTo">resourcesiam5@gmail.com</property> </to> </eventPublisher>

If WSO2 Identity Server is not configured to send tenant-wise emails, the super tenant configurations in the output-event-adapter.xml file will be utilized to send emails.