diff --git a/install/data/defaults.json b/install/data/defaults.json index cd01e7644a..6bf502abe1 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -141,6 +141,7 @@ "sendValidationEmail": 1, "includeUnverifiedEmails": 0, "emailPrompt": 1, + "requireEmailAddress": 0, "inviteExpiration": 7, "dailyDigestFreq": "off", "digestHour": 17, diff --git a/public/language/en-GB/user.json b/public/language/en-GB/user.json index a7920e9076..ae12d79fb5 100644 --- a/public/language/en-GB/user.json +++ b/public/language/en-GB/user.json @@ -206,6 +206,7 @@ "consent.export-posts-success": "Exporting posts, you will get a notification when it is complete.", "emailUpdate.intro": "Please enter your email address below. This forum uses your email address for scheduled digest and notifications, as well as for account recovery in the event of a lost password.", - "emailUpdate.optional": "This field is optional. You are not obligated to provide your email address, but without a validated email, you will not be able to recover your account or login with your email.", + "emailUpdate.optional": "This field is optional. You are not obligated to provide your email address, but without a validated email you will not be able to recover your account or login with your email.", + "emailUpdate.required": "This field is required.", "emailUpdate.change-instructions": "A confirmation email will be sent to the entered email address with a unique link. Accessing that link will confirm your ownership of the email address and it will become active on your account. At any time, you are able to update your email on file from within your account page." } diff --git a/src/user/interstitials.js b/src/user/interstitials.js index e0a0d66a55..6f641336fa 100644 --- a/src/user/interstitials.js +++ b/src/user/interstitials.js @@ -26,7 +26,10 @@ Interstitials.email = async (data) => { data.interstitials.push({ template: 'partials/email_update', - data: { email }, + data: { + email, + requireEmailAddress: meta.config.requireEmailAddress, + }, callback: async (userData, formData) => { // Validate and send email confirmation if (userData.uid) { diff --git a/src/views/partials/email_update.tpl b/src/views/partials/email_update.tpl index 7cace6b9fc..96444dc49c 100644 --- a/src/views/partials/email_update.tpl +++ b/src/views/partials/email_update.tpl @@ -1,6 +1,10 @@

[[user:emailUpdate.intro]]

+ {{{ if requireEmailAddress }}} +

[[user:emailUpdate.required]]

+ {{{ else }}}

[[user:emailUpdate.optional]]

+ {{{ end }}}