Mailer allows to send emails to the users.

Method Description Send an email to a recipient

Mailer.sendMail() - Send an Email to a Recipient

Send an email to a recipient.

Mailer.sendMail(userOid, templateName, substituteParams , [options]) : $.Promise

userOid String The recipient user’s oid.
templateName String The template Name.
substituteParams Object The placeholder names parameters used in the template.
options.emailPropertyName Object The property name to use for the email address (default: _username).
Return Value
$.Promise object Use done(), fail() and always() methods to get results.
Errors Code

The error is returned as an Error object.

-32602 Invalid params
-32603 Internal error (When the server failed to send mail)
11 User login is required.


The following sample denotes how to send an email using the "template_a" template. In this case, the "name" parameter is replaced by "John" in the message.

var username = 'John';"userOidA", "template_a", {"name": username})
    { /* What to do after sending an email is success. */ }