Startseite > Template- und Themeprogrammierung > Account- & Passwort-Reset-Templates > password_reset / request.liquid

request.liquid

Das Template <keyword>request.liquid</keyword> rendert den Request-Step des Passwort-Reset-Workflows.

Speicherort

Das Template muss unter <keyword>templates/password_reset/request.liquid</keyword> abgelegt werden.

Verfügbare Objekte

Innerhalb des <keyword>request.liquid</keyword> Templates stehen folgende Objekte zur Verfügung:

Beispiel-Template

Das nachfolgende Beispiel zeigt die Anzeige eines Formulars für das Verschicken einer Anfrage für Zurücksetzen des Account-Passworts.

<h2>Request new password</h2>

{% assign form = workflow.current_step.forms.customer_email %}
{% if form.post_successful == true %}
    {% comment %}Success message{% endcomment %}
    Thank you for your request!<br/><br/>
    An email has been sent to the email address of your customer account.<br/>
    Please open this email and follow the instructions in the email.<br/>
    Please note, that you should do this within {{ workflow.current_step.link_duration }} hours. <br/><br/>
    If you do not receive this email, please contact our customer service: {{ workflow.current_step.contact_email }}<br/>
    Please check beforehand, whether the email has been received in your spam folder and note that the delivery may take up to 15 minutes, depending on the email provider.
{% else %}
    {% comment %}Request form{% endcomment %}
    <form method="post" action="{{ form.action }}">

        {% unless form.valid %}
          <p><b>There are errors in this form.</b></p>
        {% endunless %}
        
        {% if form.recaptcha.recaptcha_challenge_error == true %}
          <p><b>Please check the completed captcha!</b></p>
        {% endif %}        
        
        <ul>
          <li>
            {% comment %}Field for username or email{% endcomment %}
            <label for="{{ form.fields.user_name.name }}">E-Mail *</label>
            <input type="email"
                   {% if form.fields.user_name.required %}required{% endif %}
                   {% if form.fields.user_name.max_length %}maxlength="{{ form.fields.user_name.max_length }}"{% endif %}
                   name="{{ form.fields.user_name.name }}"
                   value="{{ form.fields.user_name.value }}" />
          </li>
          <li>
            {% comment %}Google-ReCaptcha2{% endcomment %}  
            <script type="text/javascript" src='https://www.google.com/recaptcha/api.js' async defer></script>
            <label {{ form.recaptcha.recaptcha_sitekey }} >Captcha *</label>
            <div class="g-recaptcha" data-sitekey="{{ form.recaptcha.recaptcha_sitekey }}"></div>
          </li>
        </ul>
    
        {% comment %}Submit-Button{% endcomment %}
        <input type="submit" value="Continue">
    </form>
{% endif %}