improve email preview

This commit is contained in:
GotPPay
2018-01-19 19:50:21 +01:00
parent 9cff3cd9ae
commit e2d76ff03e

View File

@@ -23,10 +23,22 @@ module.exports = {
sendEmal: function (name, fromEmail, message, toEmail) {
return new Promise ((resolve, reject) => {
let messageBody =
'Hello. User ' +
'Hello. User left you a message on Saburly service using Alexa skill. \r\nMessage : ' +
message +
'\r\nName : ' +
name +
' left you a message on Saburly service using Alexa. Content of the message : ' +
message;
'\r\nEmail : ' +
fromEmail +
'\r\nYour Saburly team';
let messageBodyHTML =
'<p>Hello. User left you a message on Saburly service using Alexa skill.</p><br/><b>Message : </b><br/><p>' +
message +
'</p><br/><p>Name : ' +
name +
'</p><br/><p>Email : ' +
fromEmail +
'</p><br/><b>Your Saburly team</b>';
let transporter = nodemailer.createTransport ({
host: 'smtp.mail.com',
@@ -39,11 +51,12 @@ module.exports = {
});
var mailOptions = {
from: fromEmail,
from: 'saburly@mail.com',
replyTo: fromEmail,
to: toEmail,
subject: 'Message from Saburly service',
text: messageBody,
html: messageBodyHTML
};
transporter.sendMail (mailOptions, (error, info) => {