SMTP Configuration
...
You can browse to SMTP transport module for Nodemailer documentation to make sure you use the right configuration.
Code Block |
---|
language | js |
---|
title | SMTP transport Example |
---|
|
{
"from": "soajs@your.cloud.io",
"transport": {
"type": "smtp",
"options": {
"host": "smtp.mailgun.org",
"port": 465,
"auth": {
"user": "soajs@your.cloud.io",
"pass": "xxxxxx"
}
}
} |
Email Content Configuration
...
Variables used:
...
You have full control over the content of the email that SOAJS URAC send. below is an example on how to configure the links and the email contents.
Code Block |
---|
language | js |
---|
title | URAC mail configuration |
---|
|
{
"link": {
"join": "https://YOURDOMAIN/#/join/validate",
"forgotPassword": "https://YOURDOMAIN/#/resetPassword",
....
},
"sms": {
"inviteToJoin": {
"mediaUrl": ["URL/media"],
"content": "Hi {{firstName}} {{lastName}}, you have been invite to join our App, here is the invitation code {{code}}"
},
"joinInvite": {
"mediaUrl": ["URL/media"],
"content": "Hi {{firstName}} {{lastName}}, thank you for joining our App, here is the validation code {{code}}"
}
},
"mail": {
"join": {
"subject": "Welcome to SOAJS",
"path": "/opt/soajs/node_modules/soajs.urac/mail/urac/join.tmpl"
},
"forgotPassword": {
"subject": "Reset Your Password at SOAJS",
"content": "<p>Dear <b>{{ username }}</b>, <br />Your account status has changed to <b>{{ status }}</b> by the administrator on {{ ts|date('F jS, Y') }}.<br /><br /> Regards,<br/> SOAJS Team. </p>"
},
....
}
} |
The list of templates
Name | Description |
---|
addUser | The email content that a user receives while adding a new user |
changeEmail | The email content that a user receives while changing the email to confirm the new email address |
changeEmail_code |
|
changeUserStatus | The email content that a user receives on status change |
forgotPassword | The email content that a user receives while resetting the password |
forgotPassword_code |
|
invitePin | The email content that a user receives with the pin code once invited |
join | The email content that a user receives on join |
resetPin | the email content that a user receives while resetting the pin |
What data is available for you to be used in the email content
- The entire user record. For more information go here User Model.
- The following extra variable in addition to the user record are also available:
- limit: expiry of the link in hours.
Links: - link: The link with the token. Check the section below with an example about
links- link.
- ts: the timestamp, if you want to highlight the date and time
Example
Custom Content of mail. As a template engine soajs is using https://handlebarsjs.com
Code Block |
---|
language | xml |
---|
title | Mail ContentReset password |
---|
|
"<p>Dear <b>{{username}}</b>, <br />You have requested to reset your password.
<br />Please click the following link to proceed: <a href='{{link.forgotPassword}}'>{{link.forgotPassword}}</a>.
<br />Please note that the above link will expire in {{limit}} hours.<br /><br />Regards,<br/>SOAJS Team.</p>" |
Links
...
Code Block |
---|
|
<p>Dear <b>{{firstName}} {{lastName}}</b>, <br />
SOAJS administrator has created an account for you on {{ts}}<br />
{{#if link.addUser}}
Please click the following link to set a password to your account: <a href='{{link.addUser}}'>{{link.addUser}}</a>.<br /><br />
{{^}}
The administrator set as password the following: {{password}}<br /><br />
{{/if}}
Please note you can change your username and/or password in the 'My Account' section after you login.<br /><br />
Regards,<br/>
SOAJS Team.
</p> |
Multi lingual
Starting stingray URAC email supports multi lingual email content capabilities as follow:
Code Block |
---|
language | js |
---|
title | Link Example |
---|
| link |
{
"link": {
addUser: 'http://dashboard.soajs.org:80/#/setNewPassword',
changeEmail: 'http://dashboard.soajs.org:80/#/changeEmail/validate',
forgotPassword: 'http://dashboard.soajs.org:80/#/resetPassword',
join: 'http://dashboard.soajs.org:80/#/join/validate'
},"join": "https://YOURDOMAIN/#/join/validate",
"forgotPassword": "https://YOURDOMAIN/#/resetPassword",
....
},
"mail": {
"join": {
"subject": "Welcome to SOAJS",
"path": "/opt/soajs/node_modules/soajs.urac/mail/urac/join.tmpl"
},
"forgotPassword": {
"subject": "Reset Your Password at SOAJS",
"content": "<p>Dear <b>{{ username }}</b>, <br />Your account status has changed to <b>{{ status }}</b> by the administrator on {{ ts|date('F jS, Y') }}.<br /><br /> Regards,<br/> SOAJS Team. </p>"
},
....
}
"fr": {
"link": {
"join": "https://YOURDOMAIN/#/join/validate/fr",
"forgotPassword": "https://YOURDOMAIN/#/resetPassword/fr",
....
},
"mail": {
"join": {
"subject": "Bienvenue à SOAJS",
"path": "/opt/soajs/node_modules/soajs.urac/mail/urac/fr/join.tmpl"
},
"forgotPassword": {
"subject": "Réinitialisez votre mot de passe à SOAJS",
"content": "....."
},
....
}
}
} |