Configuring the Email Settings
Configure the email settings to send out registration confirmation emails to new users and invite existing users to register their device with WSO2 IoT Server.
In WSO2 IoT Server, user registration confirmation emails are disabled by default, and the admin needs to provide the required configuration details to enable it.
Create an email account to send out emails to users that register with WSO2 IoT Server (e.g., no-reply@foo.com).
Open theÂ
<IoTS_HOME>/conf/axis2/axis2.xml
 file, uncomment theÂmailto
ÂtransportSender
section, and configure the WSO2 IoT Server email account.<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender"> <parameter name="mail.smtp.host">smtp.gmail.com</parameter> <parameter name="mail.smtp.port">587</parameter> <parameter name="mail.smtp.starttls.enable">true</parameter> <parameter name="mail.smtp.auth">true</parameter> <parameter name="mail.smtp.user">synapse.demo.0</parameter> <parameter name="mail.smtp.password">mailpassword</parameter> <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter> </transportSender>
For
mail.smtp.user
,mail.smtp.password
, andmail.smtp.from,
 use the username, password, and email address (respectively) from the email account you set up.Example:
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender"> <parameter name="mail.smtp.host">smtp.gmail.com</parameter> <parameter name="mail.smtp.port">587</parameter> <parameter name="mail.smtp.starttls.enable">true</parameter> <parameter name="mail.smtp.auth">true</parameter> <parameter name="mail.smtp.user">no-reply</parameter> <parameter name="mail.smtp.password">$foo1234</parameter> <parameter name="mail.smtp.from">no-reply@foo.com</parameter> </transportSender>
After updating the Axis2 configurations, restart the core profile.
Optionally, configure the email sender thread pool.
Navigate to theÂemail-sender-config.xml
 file, which is in theÂ<IOTS_HOME>/conf/etc
 directory, and configure the following fields underÂ<EmailSenderConfig>
.MinThreads
:Â Defines the minimum number of threads that need to be available in the underlying thread pool when the email sender functionality is initialized.MaxThreadsÂ
:Â Defines the maximum number of threads that should serve email sending at any given time.KeepAliveDurationÂ
: Defines the duration that a connection should be kept alive. If the thread pool has initialized more connections than what was defined inÂMinThreads
, and they have been idle for more than theÂKeepAliveDuration
, those idle connections will be terminatedThreadQueueCapacityÂ
:Â Defines the maximum concurrent email sending tasks that can be queued up.
Example:
<EmailSenderConfig> <MinThreads>8</MinThreads> <MaxThreads>100</MaxThreads> <KeepAliveDuration>20</KeepAliveDuration> <ThreadQueueCapacity>1000</ThreadQueueCapacity> </EmailSenderConfig>
Optionally, customize the email templates that are in theÂ
<IoTS_HOME>/repository/resources/email-templates
 directory.ÂThe email templating functionality of WSO2 IoT Server is implemented on top of Apache Velocity, which is a free and open-source template engine.
- Open the email template that you wish to edit based on the requirement, such as the
user-enrollment.vm
oruser-registration.vm
file. - Edit theÂ
<Subject>
 andÂ<Body>
 to suit your requirement.
- If you need to accessÂ
HTTP
 orÂHTTPS
 base URLs of the server within your custom template configs, use theÂ$base-url-http
 andÂ$base-url-https
 variables, respectively. - You can update the look and feel of the email template via the WSO2 IoT Server management console too. For more information, see Customizing Email Templates for Tenants.
- Open the email template that you wish to edit based on the requirement, such as the