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 RecoveryPassword RecoveryCreating Users Using the Ask Password Option, and Sending mail OTP

To configure this, apply the 5274 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.  

    ElementDescription
    mail.smtp.hostThis is the hostname of the SMTP server.
    mail.smtp.passwordThis is the password of the sender SMTP server.
    mail.smtp.fromThis is the email address of the sender SMTP server.
    mail.smtp.userThis is the default user name of the email sender SMTP server.
    mail.smtp.portThis is the port of the SMTP server.
    mail.smtp.authThis 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.

    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>
    	</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.