less than a minute read • Updated 8 minutes ago
Customize the gift card recipient email
How to customize the email sent to gift card recipients, including where to get the default template and how to point a product category at it.
The gift card recipient email uses its own template, separate from your regular email receipt templates. It is built with the MJML email framework. You create the template under Settings > Emails, then point a product category at it — a template only becomes the gift card email once a category's Message to gift recipient field references it.
Get the default template
Start from the default template rather than a blank file. The source is on GitHub:
https://raw.githubusercontent.com/FoxyCart/2.0-templates/master/default_templates/responsive.gift.email.twig
Copy that code into a text editor, or paste it straight into the admin and edit it there.
You do not need to install MJML to work with the template. If you want to understand the framework in more depth, start with Getting Started in the MJML documentation.
Steps
Step 8 is what makes it the gift card email. Without it, the template exists but is never sent. For the wider gift card setup, see Allow customers to purchase gift cards on your store.
Styling
Add or edit inline styles on the individual elements in the template. Inline styles are what email clients render most reliably, which is why the default template uses them rather than a stylesheet.
Adding logic with Twig
You can use Twig syntax in the template to add conditions and pull in extra information.
A common use is a physical gift card option. The add-to-cart is set up so that choosing a physical card sets the gift recipient email to the store's own address and hides the field. The template then tests for that address and, when it matches, prints the transaction ID so the store has a reference for fulfilling the card by post. The same condition can print a mailing address or any other item option.
For the full list of values you can reference, see Gift card email variables reference.
Notes
A template can be saved with an error in it. If a test gift card email never arrives, check the template for mistakes before looking anywhere else.
Always send yourself a test gift card after changing the template. Errors surface as a missing email, not as a warning in the admin.
The Templates list is a flat list of your own templates — there is no dedicated gift card slot. The same template can be reused by more than one category.