feat(emails): +includeUnverifiedEmails ACP setting

v1.18.x
Julian Lam 4 years ago
parent ab9b671693
commit be97aa6f13

@ -133,6 +133,7 @@
"disableEmailSubscriptions": 0,
"emailConfirmInterval": 10,
"removeEmailNotificationImages": 0,
"includeUnverifiedEmails": 0,
"inviteExpiration": 7,
"dailyDigestFreq": "off",
"digestHour": 17,

@ -36,6 +36,7 @@
"subscriptions.disable": "Disable email digests",
"subscriptions.hour": "Digest Hour",
"subscriptions.hour-help": "Please enter a number representing the hour to send scheduled email digests (e.g. <code>0</code> for midnight, <code>17</code> for 5:00pm). Keep in mind that this is the hour according to the server itself, and may not exactly match your system clock.<br /> The approximate server time is: <span id=\"serverTime\"></span><br /> The next daily digest is scheduled to be sent <span id=\"nextDigestTime\"></span>",
"notifications.settings": "Email notification settings",
"notifications.remove-images": "Remove images from email notifications"
"notifications.remove-images": "Remove images from email notifications",
"include-unverified-emails": "Send emails to recipients who have not explicitly confirmed their emails",
"include-unverified-warning": "By default, users with emails associated with their account have already been verified, but there are situations where this is not the case (e.g. SSO logins, grandfathered users, etc). <strong>Enable this setting at your own risk</strong> &ndash; sending emails to unverified addresses may be a violation of regional anti-spam laws."
}

@ -228,7 +228,7 @@ Emailer.send = async (template, uid, params) => {
}
const allowedTpls = ['verify_email', 'welcome', 'registration_accepted'];
if (!userData['email:confirmed'] && !allowedTpls.includes(template)) {
if (!meta.config.includeUnverifiedEmails && !userData['email:confirmed'] && !allowedTpls.includes(template)) {
if (process.env.NODE_ENV === 'development') {
winston.warn(`uid : ${uid} (${userData.email}) has not confirmed email, not sending "${template}" email.`);
}

@ -11,6 +11,7 @@
</p>
<input type="text" class="form-control input-lg" id="email:from" data-field="email:from" placeholder="info@example.org" /><br />
</div>
<div class="form-group">
<label for="email:from_name"><strong>From Name</strong></label>
<p class="help-block">
@ -18,6 +19,43 @@
</p>
<input type="text" class="form-control input-lg" id="email:from_name" data-field="email:from_name" placeholder="NodeBB" /><br />
</div>
<div class="checkbox">
<label for="removeEmailNotificationImages" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" id="removeEmailNotificationImages" data-field="removeEmailNotificationImages" name="removeEmailNotificationImages" />
<span class="mdl-switch__label">[[admin/settings/email:notifications.remove-images]]</span>
</label>
</div>
<div class="checkbox">
<label for="includeUnverifiedEmails" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" id="includeUnverifiedEmails" data-field="includeUnverifiedEmails" name="includeUnverifiedEmails" />
<span class="mdl-switch__label">[[admin/settings/email:include-unverified-emails]]</span>
</label>
</div>
<p class="help-block">[[admin/settings/email:include-unverified-warning]]</p>
</form>
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/email:subscriptions]]</div>
<div class="col-sm-10 col-xs-12">
<form>
<div class="checkbox">
<label for="disableEmailSubscriptions" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" id="disableEmailSubscriptions" data-field="disableEmailSubscriptions" name="disableEmailSubscriptions" />
<span class="mdl-switch__label">[[admin/settings/email:subscriptions.disable]]</span>
</label>
</div>
<div class="form-group">
<label for="digestHour"><strong>[[admin/settings/email:subscriptions.hour]]</strong></label>
<input type="number" class="form-control input-lg" id="digestHour" data-field="digestHour" placeholder="17" min="0" max="24" />
<p class="help-block">
[[admin/settings/email:subscriptions.hour-help]]
</p>
</div>
</form>
</div>
</div>
@ -132,40 +170,4 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/email:subscriptions]]</div>
<div class="col-sm-10 col-xs-12">
<form>
<div class="checkbox">
<label for="disableEmailSubscriptions" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" id="disableEmailSubscriptions" data-field="disableEmailSubscriptions" name="disableEmailSubscriptions" />
<span class="mdl-switch__label">[[admin/settings/email:subscriptions.disable]]</span>
</label>
</div>
<div class="form-group">
<label for="digestHour"><strong>[[admin/settings/email:subscriptions.hour]]</strong></label>
<input type="number" class="form-control input-lg" id="digestHour" data-field="digestHour" placeholder="17" min="0" max="24" />
<p class="help-block">
[[admin/settings/email:subscriptions.hour-help]]
</p>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/email:notifications.settings]]</div>
<div class="col-sm-10 col-xs-12">
<form>
<div class="checkbox">
<label for="removeEmailNotificationImages" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" id="removeEmailNotificationImages" data-field="removeEmailNotificationImages" name="removeEmailNotificationImages" />
<span class="mdl-switch__label">[[admin/settings/email:notifications.remove-images]]</span>
</label>
</div>
</form>
</div>
</div>
<!-- IMPORT admin/partials/settings/footer.tpl -->

Loading…
Cancel
Save