Created
February 2, 2019 13:43
-
-
Save raulfmiranda/4299598419aa3c7e6d571a134507f51a to your computer and use it in GitHub Desktop.
DO CONTROLLER ENVIAR EMAIL AO CLIENTE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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