v1.18.x
Barış Soner Uşaklı 7 years ago
parent e56d20feda
commit cfb9784527

@ -7,6 +7,9 @@
"greeting_no_name": "Hello",
"greeting_with_name": "Hello %1",
"email.verify-your-email.subject": "Please verify your email",
"email.verify.text1": "Your email address has changed!",
"welcome.text1": "Thank you for registering with %1!",
"welcome.text2": "To fully activate your account, we need to verify that you own the email address you registered with.",
"welcome.text3": "An administrator has accepted your registration application. You can login with your username/password now.",

@ -100,14 +100,16 @@ UserEmail.sendValidationEmail = function (uid, options, callback) {
},
function (username, next) {
var title = meta.config.title || meta.config.browserTitle || 'NodeBB';
translator.translate('[[email:welcome-to, ' + title + ']]', meta.config.defaultLang, function (subject) {
var subject = options.subject || '[[email:welcome-to, ' + title + ']]';
var template = options.template || 'welcome';
translator.translate(subject, meta.config.defaultLang, function (subject) {
var data = {
username: username,
confirm_link: confirm_link,
confirm_code: confirm_code,
subject: subject,
template: 'welcome',
template: template,
uid: uid,
};
@ -115,7 +117,7 @@ UserEmail.sendValidationEmail = function (uid, options, callback) {
plugins.fireHook('action:user.verify', { uid: uid, data: data });
next();
} else {
emailer.send('welcome', uid, data, next);
emailer.send(template, uid, data, next);
}
});
},

@ -223,6 +223,8 @@ module.exports = function (User) {
if (parseInt(meta.config.requireEmailConfirmation, 10) === 1 && newEmail) {
User.email.sendValidationEmail(uid, {
email: newEmail,
subject: '[[email:email.verify-your-email.subject]]',
template: 'verify_email',
});
}
User.setUserField(uid, 'email:confirmed', 0, next);

@ -0,0 +1,53 @@
<!-- IMPORT emails/partials/header.tpl -->
<!-- Email Body : BEGIN -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="max-width: 600px;">
<!-- Hero Image, Flush : BEGIN -->
<tr>
<td bgcolor="#efeff0" style="text-align: center; background-image: url({url}/assets/images/emails/triangularbackground.png); background-size: cover; background-repeat: no-repeat;">
<img src="{url}/assets/images/emails/emailconfirm.png" width="300" height="300" border="0" align="center" style="width: 300px; height: 300px; max-width: 300px; height: auto; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;" class="g-img">
</td>
</tr>
<!-- Hero Image, Flush : END -->
<!-- 1 Column Text + Button : BEGIN -->
<tr>
<td bgcolor="#efeff0">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="padding: 40px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;">
<h1 style="margin: 0 0 10px 0; font-family: sans-serif; font-size: 24px; line-height: 27px; color: #333333; font-weight: normal;">[[email:verify.text1]]</h1>
<p style="margin: 0;">[[email:welcome.text2]]</p>
</td>
</tr>
<tr>
<td style="padding: 0 40px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;">
<!-- Button : BEGIN -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" style="margin: auto;">
<tr>
<td style="border-radius: 3px; background: #222222; text-align: center;" class="button-td">
<a href="{confirm_link}" style="background: #222222; border: 15px solid #222222; font-family: sans-serif; font-size: 13px; line-height: 1.1; text-align: center; text-decoration: none; display: block; border-radius: 3px; font-weight: bold;" class="button-a">
<span style="color:#ffffff;" class="button-link">&nbsp;&nbsp;&nbsp;&nbsp;[[email:welcome.cta]]&nbsp;&nbsp;&nbsp;&nbsp;</span>
</a>
</td>
</tr>
</table>
<!-- Button : END -->
</td>
</tr>
<tr>
<td style="padding: 40px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;">
<h2 style="margin: 0 0 10px 0; font-family: sans-serif; font-size: 18px; line-height: 21px; color: #333333; font-weight: bold;">[[email:closing]]</h2>
<p style="margin: 0;">{site_title}</p>
</td>
</tr>
</table>
</td>
</tr>
<!-- 1 Column Text + Button : END -->
</table>
<!-- Email Body : END -->
<!-- IMPORT emails/partials/footer.tpl -->
Loading…
Cancel
Save