menu

SiteGenesis / Server-side JS / Module: models/EmailModel

Model for email functionality. Creates an EmailModel class with methods to prepare and get email.

Source:

module:models/EmailModel

The Email Model class

Source:

Classes

EmailModel

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.

Source:
Returns:
Type
module:models/EmailModel~EmailModel

(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.

Source:
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