improve email preview
This commit is contained in:
@@ -23,10 +23,22 @@ module.exports = {
|
|||||||
sendEmal: function (name, fromEmail, message, toEmail) {
|
sendEmal: function (name, fromEmail, message, toEmail) {
|
||||||
return new Promise ((resolve, reject) => {
|
return new Promise ((resolve, reject) => {
|
||||||
let messageBody =
|
let messageBody =
|
||||||
'Hello. User ' +
|
'Hello. User left you a message on Saburly service using Alexa skill. \r\nMessage : ' +
|
||||||
|
message +
|
||||||
|
'\r\nName : ' +
|
||||||
name +
|
name +
|
||||||
' left you a message on Saburly service using Alexa. Content of the message : ' +
|
'\r\nEmail : ' +
|
||||||
message;
|
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 ({
|
let transporter = nodemailer.createTransport ({
|
||||||
host: 'smtp.mail.com',
|
host: 'smtp.mail.com',
|
||||||
@@ -39,11 +51,12 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var mailOptions = {
|
var mailOptions = {
|
||||||
from: fromEmail,
|
from: 'saburly@mail.com',
|
||||||
replyTo: fromEmail,
|
replyTo: fromEmail,
|
||||||
to: toEmail,
|
to: toEmail,
|
||||||
subject: 'Message from Saburly service',
|
subject: 'Message from Saburly service',
|
||||||
text: messageBody,
|
text: messageBody,
|
||||||
|
html: messageBodyHTML
|
||||||
};
|
};
|
||||||
|
|
||||||
transporter.sendMail (mailOptions, (error, info) => {
|
transporter.sendMail (mailOptions, (error, info) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user