Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // templates/default.php
- {% if auth %}
- <p>Hello {{ auth.getFirstNameOrUsername }},</p>
- {% else %}
- <p>Hello there,</p>
- {% endif %}
- {% block content %}{% endblock %}
- // send.php (this shows the form to send an email to all subscribed users)
- {% extends 'templates/default.php' %}
- {% block title %}Send mass email{% endblock %}
- {% block content %}
- <form action="{{ urlFor('mail.send.post') }}" method="post" autocomplete="off" class="input">
- <label for="subject">Subject</label>
- <input type="text" name="subject" id="subject" class="input" value="{{ request.post('subject') }}">
- {% if errors.has('subject') %}<span class="error">{{ errors.first('subject') }}</span>{% endif %}
- <label for="body">Body <small></small>(max. 128)</label>
- <textarea name="body" id="body" class="input">{{ request.post('body') }}</textarea>
- {% if errors.has('body') %}<span class="error">{{ errors.first('body') }}</span>{% endif %}
- <input type="submit" value="Send email" class="button">
- <input type="hidden" name="{{ csrf_key }}" value="{{ csrf_token }}">
- </form>
- {% endblock %}
- // subscribe.php (again, this is the input form to subscribe)
- {% extends 'templates/default.php' %}
- {% block title %}Subscribe{% endblock %}
- {% block content %}
- <form action="{{ urlFor('mail.subscribe.post') }}" method="post" autocomplete="off" class="input">
- <label for="name">Name</label>
- <input type="text" name="name" id="name"{% if request.post('name') %} value="{{ request.post('name') }}"{% endif %} class="input">
- {% if errors.has('name') %}<span class="error">{{ errors.first('name') }}</span>{% endif %}
- <label for="email">Email</label>
- <input type="text" name="email" id="email"{% if request.post('email') %} value="{{ request.post('email') }}"{% endif %} class="input">
- {% if errors.has('email') %}<span class="error">{{ errors.first('email') }}</span>{% endif %}
- <input type="submit" value="Subscribe" class="button">
- <input type="hidden" name="{{ csrf_key }}" value="{{ csrf_token }}">
- </form>
- {% endblock %}
- // mail/confirm.php
- {% extends 'email/templates/default.php' %}
- {% block content %}
- <p>Thank you for confirming, you have been subscribed.</p>
- {% endblock %}
- // mail/send.php
- {% extends 'email/templates/default.php' %}
- {% block content %}
- <br /><br />
- {{ body }}
- <br /><br />
- <a href="%unsubscribe_url%">Unsubscribe</a>
- {% endblock %}
- // mail/subscribe.php
- {% extends 'email/templates/default.php' %}
- {% block content %}
- <p>You have subscribed.</p>
- <p>Activate your subscription by clicking this link:
- <a href="{{ baseUrl }}{{ urlFor('mail.confirm') }}?hash={{ hash|url_encode }}">
- {{ baseUrl }}{{ urlFor('mail.confirm') }}?hash={{ hash|url_encode }}
- </a>
- </p>
- {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement