Email Lost Password


Email Lost Password

This email is sent to the user when they request to change the password for their account.
The email contains a link to a page that allows the user to reset their password.
If the user's account is Facebook connected, the email can also contain a link to page that deletes the Facebook connect, and allows the user to set their password.
If the user's account is connected via any other Social Connect means ( such as Janrain or Gigya ), the email can contail a link to delete those as well.

To be able to send this email, make sure that the lostpassword checkbox is checked in the User Actions in the Application Settings.

To create the template follow these steps:

  • go to the application in your project
  • select Email Templates
  • create the desired email text/format (sample email templates are provided lower on this page)
  • configure the email options by clicking on the Info button and filling in the following fields:
    • Template Name - set the Template Name as 'lostPassword'
    • Wrapper Template - set as 'raw HTML' or 'HTML'
    • Subject - example: 'You lost your password'
    • Sender - example: 'no-reply@yourdomain.com'
  • save the template

Go to the communitygroupinfo page for the group and select the 'lostpassword' template name in the Email Template field.
This will enable emails to be sent out to users using that email template.

Supported Attributes

NameDescription
username The username of the recipient of the email.
resetpasswordurl The url of the page that allows the user to change his/her password.
resetpasswordsecureurl The secure url (ie: it uses HTTPS) of the page that allows the user to change his/her password.
resetpasswordquery The action and parameters that passed in the resetpasswordurl (or resetpasswordsecureurl) without the domain.
Sample value:
'action/resetpassword?secret1=' . $secret1 . '&secret2=' . $secret2 . '&uid=' . $userInfo['id']

Example 1:

This email template which provides a link for the user to reset their password.

<p><fm:UserList fields="id,user,firstname,lastname" user="{$$username}"> <fm:Loop> Dear {$$user.firstname}, </fm:Loop> </fm:UserList> </p> <p>We have received a request to reset your password. <br /> If you didn't initiate this, you can simply ignore this email. </p> <p>Click the following link to reset your password<br /> {$$resetpasswordurl}&redirectUrl=/userprofile<br /> If you can't click this link, copy and paste it into the address bar of your browser and press enter. </p>

Example 2: Update Password vs Facebook Unlink

This email template determines ( based on the user's Social Connect accounts ) which link to provide:
a) to just update the user's password, without deleting the user's Facebook Connect reference (or any other 3rd party connect references).
b) or one to unlink Facebook Connect (and set their password)

<fm:UserInfo uid="{$$user.id}"> <p>Hi {$$user.firstname},</p> <fm:If value="{$facebookConnect}" compareTo="1" comparison="="> <p>We have received a request to reset your password, however you have registered for the Community using Facebook Connect.</p> <p>To unlink your account from Facebook <a href="{$facebookunlinkurl}&redirectUrl=/userprofile">click here</a> and then reset your password. <BR><BR> {facebookunlinkurl} {$facebookunlinkurl}&redirectUrl=/userprofile </p> <fm:Else> <p>We have received a request to reset your password. If you didn't initiate this, you can simply ignore this email.</p> <p>Click the following link to reset your password:<br /><br /> {$resetpasswordurl}&redirectUrl=/userprofile&utm_source=notification&utm_medium=email&utm_campaign=Lost+Password<br /><br /> If you can't click this link, copy and paste it into the address bar of your browser and press enter.</p> </fm:Else> </fm:If> </fm:UserInfo>

Example 3: Update Password vs Facebook Unlink vs Social Connect unlink

This email template determines ( based on the user's Social Connect accounts ) which link to provide: a) to just update the user's password, without deleting any social account links b) or one to unlink Facebook Connect (and set their password). Here, if the user has other 3rd party connect references, you can provide $socialconnectunlinkurl which is a link to delete ALL of the user's 3rd part references.

<fm:UserInfo uid="{$$user.id}"> <p>Dear {$$user.firstname},</p> <fm:If value="{$facebookConnect}" compareTo="1" comparison="="> <p> We have received a request to reset your password, however the account is associated with a Facebook account.</p> <p>To unlink your account from Facebook <a href="{$facebookunlinkurl}&redirectUrl=/userprofile">click here</a> and then reset your password. </p> <p> To unlink your account from ALL your social connect profiles <a href="{$socialconnectunlinkurl}&redirectUrl=/userprofile">click here</a> and then reset your password. </p> <fm:Else> <p>We have received a request to reset your password. If you didn't initiate this, you can simply ignore this email.</p> <p>Click the following link to reset your password:<br /><br /> {$resetpasswordurl}&redirectUrl=/userprofile<br /><br /> If you can't click this link, copy and paste it into the address bar of your browser and press enter.</p> </fm:Else> </fm:If> </fm:UserInfo>

See Also: