SMTP Configuration
You can browse to SMTP transport module for Nodemailer documentation to make sure you use the right configuration.
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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
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 | ||||
---|---|---|---|---|
| ||||
{ "link": { "join": "https://dev-site.rockspoon.io/#/join/validate", "forgotPassword": "https://dev-site.rockspoon.io/#/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>" }, .... } } |
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.
- link: The link with the token. Check the section below with an example about 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
...