Model for email functionality. Creates an EmailModel class with methods to prepare and get email.
module:models/EmailModel
The Email Model class
Classes
Methods
(inner) EmailModel/get(template, recipient) → {module:models/EmailModel~EmailModel}
Gets a wrapped email instance.
Parameters:
Name | Type | Description |
---|---|---|
template |
String |
The template that is rendered and sent as email. |
recipient |
String |
The email address where the text of the rendered template is sent. |
Returns:
(inner) EmailModel/send(args) → {dw.system.Status}
Prepares the email that is queued to the internal mail system for delivery.
Parameters:
Name | Type | Description |
---|---|---|
args |
Object |
object added to the HashMap used when rendering the email template. |
Returns:
Status tells whether the mail was successfully queued ( Status.OK) or not ( Status.ERROR). If an error is thrown, more information about the reason for the failure can be found within the log files. If the mandatory fields from, content, and subject are empty an IllegalArgumentException is thrown. An llegalArgumentException is thrown if neither to, cc, nor bcc are set.
- Type
- dw.system.Status