Email templates in your theme
Overview of all email templates in Shoporama themes. Learn what each template does, when it's sent, and what variables you can use to customize your emails.
Shoporama themes contain a number of email templates that control the automatic emails your online store sends. All templates are located in the templates/mails/ folder in your theme and use Smarty as the template language.
The default themes (Delaware, DelawareDK, California, Alaska2, Washington) have all the templates included from the start. If you build your own theme, you can copy them from a default theme.
Tip for customizing
You can customize the subject line and introductory text for most emails directly in admin under Settings → Emails - without editing the templates.
Order-related emails
| Template | When is it sent? | Most important variables |
|---|---|---|
invoice.html | Order confirmation - sent immediately after the customer has completed an order | $order, $webshop, $settings.company.* |
order_sent.html | When order status changes to "Shipped" - incl. track & trace | $order, $order->getTrackingUrl() |
order_ready_for_pickup.html | When the order is ready for pickup | $order, $pickup_name, $pickup_address |
order_picked_up.html | When the order is picked up | $order, $settings.company.* |
order_credit.html | When a credit note is created | $order, $order->getPublicUrl() |
payment_mail.html | Payment link - when the order is awaiting payment | $order, $payment_url |
return_label.html | When return label is generated (PDF attached) | $order |
return_received.html | When returned items are received | $order, $order_return |
invoice_dropshipping.html | Sent to supplier for dropshipping orders | $order, $webshop |
Marketing emails
| Template | When is it sent? | Main variables |
|---|---|---|
basket_mail.html | Abandoned basket email - automatically sent X hours after the customer leaves the basket | $basket, $basket_url |
after_purchase.html | Follow-up email with product recommendations - sent X hours after purchase | $order, $webshop->getAfterPurchase($products) |
product_review_mail.html | Request product review - sent X hours after purchase | $order, $order->getPublicUrl('product_review') |
Stock emails
| Template | When will it be sent? | Main variables |
|---|---|---|
in_stock_mail.html | When an out-of-stock product comes back in stock (customer has opted in) | $product, $variant_name |
out_of_stock_mail.html | When a product goes out of stock (sent to merchant) | $product |
Customer emails
| Template | When is it sent? | Main variables |
|---|---|---|
user-welcome-mail.html | When a new customer account is created | $customer, $customer->getTokenUrl() |
user-reset-password-mail.html | When the customer requests a new password | $customer, $customer->getTokenUrl() |
user-points-expires-mail.html | When the customer's loyalty points are about to expire | $customer, $points_to_expire, $points_expire_date |
Shared include files
The templates use shared includes for layout and reusable blocks:
email.wrapper.start.html/email.wrapper.end.html- HTML frame with logo and footeremail.order.details.html- Invoice and shipping addressemail.order.products.html- Product list with images, SKU and pricesemail.order.recommendations.html- Product recommendationsemail.basket.products.html- Basket products for abandoned basket emailemail.order.terms.html- Terms of trade and privacy policy
Customization without editing templates
Most emails can be customized directly in the admin under Settings → Emails:
- Subject line - Customize the subject line for each email type
- Introductory text - Add custom text at the top of the email
- Logo - Set under Settings → Theme settings and automatically used in all emails
Global variables
These Smarty variables are available in all mail templates:
$settings.company.name Company name $settings.company.phone Phone number $settings.company.email Email $settings.company.address Address $settings.company.zipcode Postal code $settings.company.city City $settings.company.vat VAT number $settings.currency.display Currency symbol (e.g. "kr.") $settings.general.thousand Thousand separator $settings.general.decimal Decimal separator $settings.theme.logo_url Company logo URL $webshop->getName() Webshop name $webshop->getUrl() Webshop URL
Tips for customization
- Use UTM codes on links in your emails so you can measure the impact in Google Analytics
- You can use Smarty logic for dynamic content - for example, write "Happy weekend" on Friday with
{if $smarty.now|date_format:'%u' == 5} - Always copy templates from a default theme as a starting point - they already contain responsive HTML and all necessary variables
- Test your emails by creating a test order and completing the flow
Need help customizing your email templates? Contact us at support@shoporama.dk.