HTMLify user added email to admins
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<%if (format === 'text') { %>
|
||||
|
||||
Hi <%= cloudronName %> Admin,
|
||||
Dear <%= cloudronName %> Admin,
|
||||
|
||||
User with email <%= user.alternateEmail || user.email %> was added to <%= cloudronName %>.
|
||||
A new user with email <%= user.alternateEmail || user.email %> was added to <%= cloudronName %>.
|
||||
|
||||
<% if (inviteLink) { %>
|
||||
As requested, this user has not been sent an invitation email.
|
||||
@@ -12,7 +12,38 @@ To set a password and perform any configuration on behalf of the user, please us
|
||||
|
||||
<% } %>
|
||||
|
||||
|
||||
Powered by https://cloudron.io
|
||||
|
||||
<% } else { %>
|
||||
|
||||
<center>
|
||||
|
||||
<img src="<%= cloudronAvatarUrl %>" width="128px" height="128px"/>
|
||||
|
||||
<h3>Dear <%= cloudronName %> Admin,</h3>
|
||||
|
||||
<p>
|
||||
A new user with email <%= user.alternateEmail || user.email %> was added to <%= cloudronName %>.
|
||||
</p>
|
||||
|
||||
<% if (inviteLink) { %>
|
||||
<p>
|
||||
As requested, this user has not been sent an invitation email.<br/>
|
||||
<br/>
|
||||
<a href="<%= inviteLink %>">Set a password and perform any configuration on behalf of the user</a>
|
||||
</p>
|
||||
<% } %>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div style="font-size: 10px; color: #333333; background: #ffffff;">
|
||||
Powered by <a href="https://cloudron.io">Cloudron</a>.
|
||||
</div>
|
||||
|
||||
</center>
|
||||
|
||||
<img src="https://analytics.cloudron.io/piwik.php?idsite=2&rec=1&e_c=CloudronEmail&e_a=userAdded" style="border:0" alt="" />
|
||||
|
||||
<% } %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%if (format === 'text') { %>
|
||||
|
||||
Hi <%= user.displayName || user.username || user.alternateEmail || user.email %>,
|
||||
Dear <%= user.displayName || user.username || user.alternateEmail || user.email %>,
|
||||
|
||||
Welcome to <%= cloudronName %>!
|
||||
|
||||
@@ -12,7 +12,7 @@ You are receiving this email because you were invited by <%= invitor.email %>.
|
||||
<% } %>
|
||||
|
||||
|
||||
Powered by Cloudron.io
|
||||
Powered by https://cloudron.io
|
||||
|
||||
<% } else { %>
|
||||
|
||||
|
||||
@@ -290,15 +290,22 @@ function userAdded(user, inviteSent) {
|
||||
fqdn: config.fqdn(),
|
||||
user: user,
|
||||
inviteLink: inviteSent ? null : config.adminOrigin() + '/api/v1/session/account/setup.html?reset_token=' + user.resetToken,
|
||||
format: 'text',
|
||||
cloudronName: cloudronName
|
||||
cloudronName: cloudronName,
|
||||
cloudronAvatarUrl: config.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().from,
|
||||
to: adminEmails.join(', '),
|
||||
subject: util.format('%s: user %s added', cloudronName, user.alternateEmail || user.email),
|
||||
text: render('user_added.ejs', templateData)
|
||||
text: render('user_added.ejs', templateData),
|
||||
html: render('user_added.ejs', templateDataHTML)
|
||||
};
|
||||
|
||||
enqueue(mailOptions);
|
||||
|
||||
Reference in New Issue
Block a user