Send message feature #11

Merged
senaduka merged 32 commits from send-message-feature into master 2018-01-23 12:20:02 +01:00
Showing only changes of commit e2d76ff03e - Show all commits

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) => {