feat: updated email confirmation alert to more closely reflect email usage, remembering dismissal

v1.18.x
Julian Lam 4 years ago
parent 58adb76246
commit bbbacd86ab

@ -38,7 +38,7 @@
"email-not-confirmed": "You are unable to post until your email is confirmed, please click here to confirm your email.",
"email-not-confirmed-chat": "You are unable to chat until your email is confirmed, please click here to confirm your email.",
"email-not-confirmed-email-sent": "Your email has not been confirmed yet, please check your inbox for the confirmation email. You won't be able to post or chat until your email is confirmed.",
"no-email-to-confirm": "This forum requires email confirmation, please click here to enter an email",
"no-email-to-confirm": "Your account does not have an email set. An email is necessary for account recovery. Please click here to enter an email.",
"email-confirm-failed": "We could not confirm your email, please try again later.",
"confirm-email-already-sent": "Confirmation email already sent, please wait %1 minute(s) to send another one.",
"sendmail-not-found": "The sendmail executable could not be found, please ensure it is installed and executable by the user running NodeBB.",

@ -732,21 +732,26 @@ app.cacheBuster = null;
});
};
app.showEmailConfirmWarning = function (err) {
if (!app.user.uid) {
app.showEmailConfirmWarning = async (err) => {
const storage = await app.require('storage');
if (!app.user.uid || parseInt(storage.getItem('email-confirm-dismiss'), 10) === 1) {
return;
}
var msg = {
alert_id: 'email_confirm',
type: 'warning',
timeout: 0,
closefn: () => {
storage.setItem('email-confirm-dismiss', 1);
},
};
if (!app.user.email) {
msg.message = '[[error:no-email-to-confirm]]';
msg.clickfn = function () {
app.removeAlert('email_confirm');
ajaxify.go('user/' + app.user.userslug + '/edit');
ajaxify.go('user/' + app.user.userslug + '/edit/email');
};
app.alert(msg);
} else if (!app.user['email:confirmed'] && !app.user.isEmailConfirmSent) {

Loading…
Cancel
Save