User Documentation

User:Forgot_Username template tag

The User:Forgot_Username function allows your users to retrieve their forgotten username to your site by entering in their email address on file.

{exp:user:forgot_username} content {/exp:user:forgot_username}


NOTE: In order to use this feature, you must have a data in the Forgot Username Notification Template template inside Preferences page of User control panel. An example notification template might look something like:

Hi {screen_name},

Per your request, this email contains your username for {site_name} located at {site_url}.

Username: {username}

Parameters

The following parameters are available for use:

error_page=

error_page="user/error_template"

This parameter allows you to bypass the EE message template for displaying errors, and instead show your own regular template with the error messages. Error template must follow guidelines of User Error Page.

form:attribute=

form:class="your_class"

This parameter allows you to control any form attribute for the form in your template. Simply replace attribute with an attribute name such as id, name, class, etc, and specify a value for that attribute. You can specify this parameter multiple times to control as many attributes as necessary. This would normally be done to control your form with Javascript or style it with CSS.

onsubmit=

onsubmit="some_javascript()"

This parameter allows you to execute Javascript functions at form submission.

override_return=

override_return="template_group/template"

This parameter allows you to bypass the default EE message template page and brings the user directly to the template URI specified.

return=

return="user/success"

This parameter allows you specify a return URL you'd like the user to be returned to after submitting the form.

secure_action=

secure_action="yes"

This parameter allows you to set the action on the form to have https://. Use for processing forms with SSL.

secure_return=

secure_return="yes"

This parameter allows you to set the return on the form to have https://. Use for processing forms with SSL.

Form Fields

The following form fields are available for use:

email

<input type="text" name="email" id="email" />

This field is the field in which the user would specify their email address to retrieve their username, and is a required field.

Examples

The following is a complete example of what a Forgot Username form might look like:

<h2>Forgot Username?</h2>
<p>
    If you've forgotten your username, just enter your email address you registered with and you will receive an email informing you of your username.
</p>

{exp:user:forgot_username
    return="user/success"
}
<p>
    <label for="email">Email Address <span class="required">*</span></label>
    <input type="text" name="email" id="email" />
    <button type="submit">Submit</button>
</p>
{/exp:user:forgot_username}

Support

Having problems setting up and/or using User? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.