SiteGenesis / Server-side JS / Tutorial: Sending Emails

Sending Emails

In various places throughout the application emails are being sent to notify the customer about certain events. By default those emails are being sent by the Demandware system and usually they are sent from a common email address like [email protected]. In order to make sending emails as easy as possible the [Email]{@see module:models/Email} module provides easy to use convenience methods.

// sending a simple welcome email

// send an email to a customer's mail address providing additional data for the email template
    .setSubject(dw.web.Resource.msg('email.passwordassistance', 'email', null)).send({
        Customer : customer,
        ResetPasswordToken : resetPasswordToken

Sending Emails via a 3rd party service

As all emails are send via the [Email]{@see module:models/Email} module, the 3rd party integration can hook into it's send method to i.e. call a service using the dw.svc.* APIs.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.