Advertisement
cowslaw

Mailgun Views

Dec 30th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.90 KB | None | 0 0
  1. // templates/default.php
  2. {% if auth %}
  3.     <p>Hello {{ auth.getFirstNameOrUsername }},</p>
  4. {% else %}
  5.     <p>Hello there,</p>
  6. {% endif %}
  7. {% block content %}{% endblock %}
  8.  
  9.  
  10.  
  11.  
  12.  
  13. // send.php (this shows the form to send an email to all subscribed users)
  14. {% extends 'templates/default.php' %}
  15. {% block title %}Send mass email{% endblock %}
  16. {% block content %}
  17.     <form action="{{ urlFor('mail.send.post') }}" method="post" autocomplete="off" class="input">
  18.         <label for="subject">Subject</label>
  19.         <input type="text" name="subject" id="subject" class="input" value="{{ request.post('subject') }}">
  20.         {% if errors.has('subject') %}<span class="error">{{ errors.first('subject') }}</span>{% endif %}
  21.  
  22.         <label for="body">Body <small></small>(max. 128)</label>
  23.         <textarea name="body" id="body" class="input">{{ request.post('body') }}</textarea>
  24.         {% if errors.has('body') %}<span class="error">{{ errors.first('body') }}</span>{% endif %}
  25.  
  26.         <input type="submit" value="Send email" class="button">
  27.         <input type="hidden" name="{{ csrf_key }}" value="{{ csrf_token }}">
  28.     </form>
  29. {% endblock %}
  30.  
  31.  
  32.  
  33.  
  34.  
  35. // subscribe.php (again, this is the input form to subscribe)
  36. {% extends 'templates/default.php' %}
  37. {% block title %}Subscribe{% endblock %}
  38. {% block content %}
  39.     <form action="{{ urlFor('mail.subscribe.post') }}" method="post" autocomplete="off" class="input">
  40.         <label for="name">Name</label>
  41.         <input type="text" name="name" id="name"{% if request.post('name') %} value="{{ request.post('name') }}"{% endif %} class="input">
  42.         {% if errors.has('name') %}<span class="error">{{ errors.first('name') }}</span>{% endif %}
  43.  
  44.         <label for="email">Email</label>
  45.         <input type="text" name="email" id="email"{% if request.post('email') %} value="{{ request.post('email') }}"{% endif %} class="input">
  46.         {% if errors.has('email') %}<span class="error">{{ errors.first('email') }}</span>{% endif %}
  47.  
  48.         <input type="submit" value="Subscribe" class="button">
  49.         <input type="hidden" name="{{ csrf_key }}" value="{{ csrf_token }}">
  50.     </form>
  51. {% endblock %}
  52.  
  53.  
  54.  
  55.  
  56.  
  57. // mail/confirm.php
  58. {% extends 'email/templates/default.php' %}
  59. {% block content %}
  60.     <p>Thank you for confirming, you have been subscribed.</p>
  61. {% endblock %}
  62.  
  63.  
  64.  
  65.  
  66.  
  67. // mail/send.php
  68. {% extends 'email/templates/default.php' %}
  69. {% block content %}
  70.     <br /><br />
  71.     {{ body }}
  72.     <br /><br />
  73.     <a href="%unsubscribe_url%">Unsubscribe</a>
  74. {% endblock %}
  75.  
  76.  
  77.  
  78.  
  79.  
  80. // mail/subscribe.php
  81. {% extends 'email/templates/default.php' %}
  82. {% block content %}
  83.     <p>You have subscribed.</p>
  84.  
  85.     <p>Activate your subscription by clicking this link:
  86.     <a href="{{ baseUrl }}{{ urlFor('mail.confirm') }}?hash={{ hash|url_encode }}">
  87.         {{ baseUrl }}{{ urlFor('mail.confirm') }}?hash={{ hash|url_encode }}
  88.     </a>
  89.     </p>
  90. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement