fix: #10173, don't show optional message if email is required

isekai-main
Barış Soner Uşaklı 3 years ago
parent 6a75ed50fa
commit d1eb21c56d

@ -141,6 +141,7 @@
"sendValidationEmail": 1, "sendValidationEmail": 1,
"includeUnverifiedEmails": 0, "includeUnverifiedEmails": 0,
"emailPrompt": 1, "emailPrompt": 1,
"requireEmailAddress": 0,
"inviteExpiration": 7, "inviteExpiration": 7,
"dailyDigestFreq": "off", "dailyDigestFreq": "off",
"digestHour": 17, "digestHour": 17,

@ -206,6 +206,7 @@
"consent.export-posts-success": "Exporting posts, you will get a notification when it is complete.", "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.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": "<strong>This field is optional</strong>. 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": "<strong>This field is optional</strong>. 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": "<strong>This field is required</strong>.",
"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." "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."
} }

@ -26,7 +26,10 @@ Interstitials.email = async (data) => {
data.interstitials.push({ data.interstitials.push({
template: 'partials/email_update', template: 'partials/email_update',
data: { email }, data: {
email,
requireEmailAddress: meta.config.requireEmailAddress,
},
callback: async (userData, formData) => { callback: async (userData, formData) => {
// Validate and send email confirmation // Validate and send email confirmation
if (userData.uid) { if (userData.uid) {

@ -1,6 +1,10 @@
<div class="form-group"> <div class="form-group">
<p>[[user:emailUpdate.intro]]</p> <p>[[user:emailUpdate.intro]]</p>
{{{ if requireEmailAddress }}}
<p>[[user:emailUpdate.required]]</p>
{{{ else }}}
<p>[[user:emailUpdate.optional]]</p> <p>[[user:emailUpdate.optional]]</p>
{{{ end }}}
<div class="form-group"> <div class="form-group">
<label for="email">[[global:email]]</label> <label for="email">[[global:email]]</label>
<input class="form-control" type="text" id="email" name="email" placeholder="{email}" value="{email}" /> <input class="form-control" type="text" id="email" name="email" placeholder="{email}" value="{email}" />

Loading…
Cancel
Save