Order mail example

This is an example order mail of category delivery.

Usage:

  1. Go to the Order mails module in the Settings app and create a new order mail
  2. Copy-paste the html from below into the definition

  1 <html>
  2 <head>
  3     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4     <title>Ticketmatic</title>
  5     <style type="text/css" media="screen">
  6         body, td, th {
  7           line-height: 1.5;
  8           font-size: 13px;
  9         }
 10 
 11         body {
 12           color: #333;
 13           font-family: Arial, sans-serif;
 14           background: #FFF;
 15           max-width: 660px;
 16           margin: 0 auto;
 17         }
 18 
 19         a,
 20         a:link {
 21             color: #000 !important;
 22             font-weight: 700;
 23         }
 24 
 25 
 26         th {
 27           text-align: left;
 28         }
 29 
 30         .table {
 31           width: 100%;
 32         }
 33 
 34         .table tfoot {
 35           font-weight: 700;
 36         }
 37 
 38         .table td,
 39         .table th {
 40           border-bottom: 1px solid #DDD;
 41           padding: 5px;
 42         }
 43 
 44         h1, h2, h3, h4 {
 45             color: #000;
 46         }
 47     </style>
 48 </head>
 49 <body>
 50     <br>
 51     <center>
 52        <table cellspacing="0" cellpadding="0">
 53           <tr>
 54              <td width="3%">
 55                  
 56              </td>
 57              <td width="92%" class="content">
 58                 <p translate>Dear,</p>
 59                 <p translate>Thank you very much for your order at {{account.name}}.</p>
 60                  
 61                 {% if order.allowetickets|default(15001)==15001 %}
 62                     <p translate>Please contact the box office to receive your tickets.</p>
 63                 {% elseif order.allowetickets|default(0)==15002 %}
 64                     <p translate>This is the way to receive your tickets:</p>
 65                     <ul>
 66                        <li><span translate>Print them yourself: </span><a href="{{ urls.pdf | raw }}" translate>download your e-tickets as pdf</a> <span translate>and then print them out.</span></li>
 67                     </ul>
 68                     <p translate>Store your printed tickets in a safe place. Make sure that your ticket won't be copied. Each ticket contains a unique barcode that
 69                      will be scanned at the entrance of the event.</p>
 70                 {% elseif order.allowetickets|default(0)==15003 %}
 71                     <p translate>There are two ways to receive your tickets:</p>
 72                      <ul>
 73                          <li><span translate>Print them yourself: </span><a href="{{ urls.pdf | raw }}" translate>download your e-tickets as pdf</a> <span translate>and then print them out.</span></li>
 74                          <li><span translate>Smartphone: open this e-mail on your smartphone and click on the Wallet (Passbook) ticket that you want to load onto the smartphone:</span>
 75                              <ul>
 76                                  {% for event in events %}
 77                                  {{ event.name }}
 78                                  {% for tickettypeprice in event.tickettypeprices %}
 79                                  <ul>
 80                                  {% for ticket in tickettypeprice.tickets %}
 81                                  
 82                                  <li><a href="{{ urls.passbook[ticket.id] | raw }}">Ticket {{ loop.index }}</a> ({{ticket.pricetype}})</li>
 83                                  {% endfor %}
 84                                  </ul>
 85                                  {% endfor %}
 86                                  {% endfor %}                            
 87                              </ul>
 88                          </li>
 89                      </ul>
 90                     <p translate>Store your printed tickets in a safe place. Make sure that your ticket won't be copied. Each ticket contains a unique barcode that
 91                      will be scanned at the entrance of the event.</p>
 92                     <p translate>Tip: if you want to give others your Wallet (Passbook) tickets, then send them this mail so that they can load their Passbook ticket on their own smartphone.</p>
 93                 {% endif %}
 94 
 95                 <p translate>Review the details of your order here:</p>
 96 
 97                 <ul>
 98                     <li><span translate>Order number: </span>{{ order.id }}</li>
 99                     <li><span translate>Order date: </span>{{ order.createdts|date("d/m/Y") }}</li>
100                 </ul>
101 
102                 <table class="table" cellspacing="0" cellpadding="0">
103                     <thead>
104                         <tr>
105                             <th translate>Date</th>
106                             <th translate>Item</th>
107                             <th translate>Number</th>
108                             <th translate>Subtotal</th>
109                         </tr>
110                     </thead>
111                     <tfoot>
112                         <tr>
113                             <td colspan="2"> </td>
114                             <td translate>Total</td>
115                             <td>€ {{ order.totalamount|number_format(2) }}</td>
116                         </tr>
117                     </tfoot>
118                     <tbody>
119                         {% for event in events %}
120                             {% for tickettypeprice in event.tickettypeprices %}
121                             <tr>
122                                 <td>{{ event.date|date("d/m/Y H:i") }}</td>
123                                 <td>{{ event.name }} - {{ tickettypeprice.pricetypename }}</td>
124                                 <td>{{ tickettypeprice.ticketsummary.count }}</td>
125                                 <td>€ {{ (tickettypeprice.ticketsummary.ticketfee|default(0) + tickettypeprice.ticketsummary.price)|number_format(2) }}</td>
126                             </tr>
127                             {% endfor %}
128                         {% endfor %}
129 
130                         {% for product in products %}
131                             <tr>
132                                <td></td>
133                                <td>{{lookup.products[product.productid].name|default('')}}</td>
134                                <td>1</td>
135                                <td>€ {{ product.price|default(0)|number_format(2) }}</td>
136                             </tr>
137                         {% endfor %}
138                         {% for cost in ordercosts %}
139                         <tr>
140                             <td></td>
141                             <td colspan=2>{{ cost.name }}</td>
142                             <td>€ {{ cost.amount|number_format(2) }}</td>
143                         </tr>
144                         {% endfor %}
145                     </tbody>
146                 </table>
147 
148                 <p translate>Kind regards,</p>
149 
150              </td>
151              <td width="3%">
152                  
153              </td>
154           </tr>
155        </table>
156     </center>
157     <br>
158 </body>
159 </html>

Questions?

We're always happy to help! Send us an e-mail