Managing SMS Notification Templates From the Registry¶
WSO2 Identity Server supports notifications via SMS from WSO2 Identity Server 5.10.0 onwards. This document will guide you through the process of adding a new SMS notification template and editing an existing notification template.
Before you begin
An SMS template can only have the following attributes.
- displayName
- type
- locale
- body
Having more attributes such as Footer
or Subject
will lead to errors.
Adding an SMS notification template¶
In WSO2 Identity server, the notification templates are packed by default. However, if you want to add a new SMS notification template, the following methods are available.
- Add template via configuration files
- Add template via the management console registry
Add an SMS notification template using configuration files¶
-
Navigate to the
<IS_HOME>/repository/conf/sms
folder. -
Open the
sms-templates-admin-config.xml
file to view default templates and edit them. -
Add a new template using the allowed attributes. A sample template is given below.
Note
If WSO2 IS is already running, restart the server to apply the changes.
Add an SMS notification template using the registry¶
-
Log in to the management console and navigate to Main> Registry> Browse.
-
On the tree view tab, click on system>config>identity.
-
Click Add Collection and enter
sms
as the Collection Name.(NOTE: Names are case-sensitive)
-
Click on the sms directory and click Add Collection and enter the collection name as
accountidrecovery
.Note
For this scenario,
accountidrecovery
is the type of the template. -
Click on Add Resource.
-
Select the method as Create Text Content.
-
Provide name as
en_us
. -
Add the SMS notification template body.
(NOTE: Include placeholders in the SMS template body)
["Hello, your username is {{userstore-domain}}/{{user-name}}@{{tenant-domain}}"]
-
Click on en_us resource and add the following properties.
display : accountIdRecovery type : accountIdRecovery locale : en_US
-
Click Finish to save the new notification template.
Edit an SMS notification template from the registry¶
-
Log in to the Management Console and click
Main> Registry> Browse
. -
On the
tree view
tab, clicksystem > config >identity > sms > accountidrecovery
. -
Click on
en_us
to view the template. -
Click
Display as text
to view the template or clickEdit as text
to edit the template.