Templates

How are templates used in Finqu emails?


Templates sit at the very core of Finqu emails. There is a matching file for each email that Finqu sends on your behalf to your customers. We have tried to keep up the naming convention as clear and simple as possible.

Contexts

Before diving in to the available templates, here are the currently available contexts for emails and the variables available for subject lines and templates.

customers

Emails sent to customer accounts.

Global variables

variable description
customer The customer account, a detailed property list is available here.
channel  The sales channel from which this email was sent from.

Subject line variables

variable description
FIRST_NAME Customers first name
LAST_NAME Customers last name
NAME Customers first and last name combined

orders

Emails sent with an order context.

Global variables

variable description
customer The customer account, a detailed property list is available here.
channel  The sales channel from which this email was sent from.
order Information about the order.

Subject line variables

variable description
FIRST_NAME Customers first name
LAST_NAME Customers last name
NAME Customers first and last name combined
ORDER_ID  Order unique id
ORDER_NUMBER Merchants order number for this order

Templates

Some of these templates have special variables available to provide action link or detailed context. These variables are mentioned in the last column.

Path Description Special variables
customers/recover_password.mjml.liquid Template containing the details about password recovery link_to_recovery
customers/register.mjml.liquid A greeting for becoming a customer  
orders/abandoned_cart.mjml.liquid A friendly reminder that customer still can complete their purchase link_to_cart
orders/confirmation.mjml.liquid Order confirmation link_to_order
orders/fulfillment.mjml.liquid Order fulfillment shipment, if created during fulfillment
orders/gift_card.mjml.liquid Information about the gift card gift_card, with properties value, code and expiry
orders/message.mjml.liquid Some message or information about the order shipment, if created during fulfillment, message if one was set
orders/payment_link.mjml.liquid Message containing information for customer to complete their purchase link_to_checkout
orders/return.mjml.liquid Message confirming that the customer return has been processed and received by the merchant return
orders/status.mjml.liquid Information about the order status change link_to_order

Template file structure

A template file consists these three different components, HTML and plain text versions of the email and the schema for the email. HTML is written in MJML syntax which is then compiled to HTML. Plain text version of the email is written inside the plaintext tags. Schema is defined inside the schema tag.

HTML

This is the content you want the receiver to see. It is not wrapped in any tags and you can just write your MJML and Liquid freely. Actually, anything that is not wrapped with the plaintext or schema tags is rendered to the HTML content.

Text

A simple text version of your email. It is not necessary to write this but it is a good practice. A text version will work no matter where or how the receiver is reading the email. So don’t underestimate it and create simple plain text content for your email.

Schema

This defines the schema for the template. For now, the schema contains to different keys: subject and preview.

{
    "subject": "This is the subject for the email. You can use subject line variables like this: ${FIRST_NAME}.",
    "preview": "A small preview of the contents of the email. Subject line variables work here too."
}

You can also localise the schema like this:

{
    "subject": {
        "en": "Hi ${FIRST_NAME}!",
        "fi": "Hei ${FIRST_NAME}!"
    }
}