Split welcome email between html and text version

This commit is contained in:
Johannes Zellner
2020-11-19 22:29:29 +01:00
parent 7663360ce6
commit fbe5f42536
3 changed files with 16 additions and 29 deletions
+2 -8
View File
@@ -144,18 +144,12 @@ function sendInvite(user, invitor, inviteLink) {
cloudronAvatarUrl: settings.adminOrigin() + '/api/v1/cloudron/avatar'
};
var templateDataText = JSON.parse(JSON.stringify(templateData));
templateDataText.format = 'text';
var templateDataHTML = JSON.parse(JSON.stringify(templateData));
templateDataHTML.format = 'html';
var mailOptions = {
from: mailConfig.notificationFrom,
to: user.fallbackEmail,
subject: util.format('Welcome to %s', mailConfig.cloudronName),
text: render('welcome_user.ejs', templateDataText),
html: render('welcome_user.ejs', templateDataHTML)
text: render('welcome_user-text.ejs', templateData),
html: render('welcome_user-html.ejs', templateData)
};
sendMail(mailOptions);