Skip to content

Instantly share code, notes, and snippets.

@raulfmiranda
Created February 2, 2019 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulfmiranda/4299598419aa3c7e6d571a134507f51a to your computer and use it in GitHub Desktop.
Save raulfmiranda/4299598419aa3c7e6d571a134507f51a to your computer and use it in GitHub Desktop.
DO CONTROLLER ENVIAR EMAIL AO CLIENTE
function sendEmailToCustomer(product) {
var customerEmail = customer.profile.email;
var EmailModel = require('app_storefront_controllers/cartridge/scripts/models/EmailModel');
var fromEmail = dw.system.Site.current.preferences.custom.noreplyWishlistEmail
var options = {
recipient: customerEmail,
subject: Resource.msg('email.subject', 'wishlist', null),
template: 'mail/product.isml',
from: fromEmail,
context: {
Product: product
}
}
EmailModel.sendMail(options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment