Forum

Thread tagged as: Members

Members Email Change after registration

Is it possible to allow a member to change their email address when updating their profile while still checking that it isn't already in use by another member?

Neil Irwin

Neil Irwin 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it should be. What problem are you seeing?

Hi Drew

If i use the following which is from the registration form and dont change the email it throws up an error as the email address matches one already held when you hit save.

<perch:label for="email">Email</perch:label>
<perch:error for="email" type="required"><p>Please add your email address</p></perch:error>
<perch:error for="email" type="format">Please check your email address</perch:error>
<perch:error for="email" type="helper"><p>That email address is already in use</p></perch:error>
<perch:input type="email" id="email" required="true" placeholder="you@company.com" helper="PerchMembers_Members::check_email" />

And if I take away the validation it just doesnt update the email field if the same email is used as another user has without telling you that there was an error.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can't change the email address to one that's already in use by another account - that would result in two different accounts with the same email address.

I was trying to let the email address be updated on the same page as the rest of the users profile details but when the user doesn't change the email address and you hit save it throws up the error.

I have now put the email into its own form but it still wont update when I enter a completely new email address that isnt on file. It is showing the success message but not actually updating the email address to the new one entered.


<perch:form id="email" method="post" app="perch_members"> <div class="membersForm"> <fieldset> <legend><h2>Email Update</h2></legend> <div class="membersFormInner"> <div class="input"> <perch:label for="email">Email</perch:label> <perch:error for="email" type="required"><p>Please add your email address</p></perch:error> <perch:error for="email" type="format">Please check your email address</perch:error> <perch:error for="email" type="helper"><p>That email address is already in use</p></perch:error> <perch:input type="email" id="email" required="true" placeholder="you@company.com" helper="PerchMembers_Members::check_email" /> </div> </div> <div class="submit"> <perch:input type="submit" value="Update" /> <perch:input type="hidden" id="token" /> </div> </fieldset> <div style="clear: both;"></div> </div> <perch:success> <div class="membersFormTopInner"> <div class="membersFormTop"> <div class="success"> <h3>Your email address has been updated.</h3> </div> </div> </div> </perch:success> </perch:form>
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you're editing a member, the form ID needs to be profile.