Variables in email templates

You can edit all the emails that are sent from your shop. We use simplified Twig template engine that is very similar to Liquid of Shopify. You can see a full documentation on it here

Because we use simplified Twig, when editing email templates, you can use the following constructions: 
for, if, filter, set, spaceless, do, with, autoescape

Also, the following standard filters are available for the template engine:
date, date_modify, format, replace, number_format, abs, round, url_encode, json_encode, convert_encoding, title, capitalize, upper, lower, striptags, trim, nl2br, join, split, sort, merge, batch,  reverse, length, slice, first, last, default, keys, escape, e, raw

We have implemented the following filters that are available on Shopify and on our platform: t, money, size, upcase, downcase, strip_html, strip_newlines, newline_to_br, product_img_url, user_img_url

Examples

Variable output: {{ shop.name }}

Variable output using filters: {{ product.price | money }}

Using conditions:
{% if wishlist_sale.display_buy_btn %}

 ...

{% endif %}

Using cycles: 

{% for product in  wishlist_sale.products %}

 ...

{% endfor %}


Global variables 

Every email template might have its own variables (objects). Also, in all of them you can use the following global variables: 

  • shop - information about a shop (object)
  • apps - which of our apps are enabled on your store (object)
  • from - information about a sender (object)
  • recipient - information about a recipient (object)
  • unsubscribe - Unsubscribe link. Example - "https://yourshop.myshopify.com/pages/edit-notifications"
  • privacy_text - Privacy policy text. You can modify it in Email Design section - https://www.socialshopwave.com/admin/mails-design

Here are thorough details of all available objects: 

shop  - this object will have an information about your shop:  

  • shop.url - Returns the full URL of a shop. Example - "https://yourshop.myshopify.com"
  • shop.domain - Returns the primary domain of the shop. Example - "yourdomain.com"
  • shop.email - Returns the shop's email address. Example - "email@example.com"
  • shop.name - Returns the shop's name. Example - "SocialShopWave"
  • shop.money_format - Returns a string that is used by Shopify to format money without showing the currency. Example - "${{amount}}"
  • shop.address - Returns information about a shop's address. You can modify it in Email Design section - https://www.socialshopwave.com/admin/mails-design. Example - "150 Elgin Street, Ottawa, Ontario, Canada"
apps - using this object you can check which apps are enabled or disabled:

  • apps.comment - Comments app is enabled or not
  • apps.community - Community app is enabled or not
  • apps.reviews - Reviews app is enabled or not
  • apps.wishlist - Wishlist app is enabled or not
  • apps.ask_advice - Ask advice app is enabled or not
  • apps.questions - Questions app is enabled or not
  • apps.sharing - Social sharing app is enabled or not

product - in this object will be information about products: 

  • product.product_id - Returns the id of the product.
  • product.title - Returns the title of the product.
  • product.description - Returns the description of the product.
  • product.image_url - Returns the URL of the product's featured image.
  • product.price - Returns the minimum price of all variants of the product. Use one of the money filters to return the value in a monetary format.
  • product.compare_price - Returns the compare price of the product. Use one of the money filters to return the value in a monetary format.
  • product.handle - Returns the handle of a product.
  • product.images - Returns an array of the product's images.
  • product.product_type - Returns the type of the product.
  • product.published_at - Returns the date and time when the product was published to the Online Store channel.
  • product.tags - Returns a string of all of the product's tags.
  • product.variants - Returns an array the product's variants.
  • product.vendor - Returns the vendor of the product.
  • product.url - Returns the URL of the product.
  • product.average_rating - Returns the average rating of the product. Example - "5.0"
  • product.reviews_count - Returns the reviews count of the product. Example - "5.0"
  • product.wishlist_count - Returns the number of customers who add the product to their wishlist.

user - in this object will information about a user: 

  • user.user_id - Returns the id of the user.
  • user.customer_id - Returns the customer id of the user.
  • user.name - Returns the full name of the user.
  • user.title - Returns the full name of the user.
  • user.first_name - Returns the first name of the user.
  • user.last_name - Returns the last name of the user.
  • user.email - Returns the email of the user.
  • user.url - Returns the URL to the user’s profile page.

recipient - in this object will information about a recipient: 

  • recipient.customer_id - Returns the customer id of the recipient.
  • recipient.name - Returns the full name of the recipient.
  • recipient.first_name - Returns the first name of the recipient.
  • recipient.last_name - Returns the last name of the recipient.
  • recipient.email - Returns the email of the recipient.
  • recipient.url - Returns the URL to the user’s profile page.

sender (from) - in this object will information about a sender:  

  • sender.name - Returns the name of the sender.
  • sender.email - Returns the email of the sender.

action - in this object will information about an actions in a Community Feed:

  • action.wall_id - Returns the id of the action.
  • action.user_id - Returns the id of the user.
  • action.type - Returns the type of the action.
  • action.title - Returns the title of the action.
  • action.description - Returns the description of the action.
  • action.url - Returns the URL of the action.
  • action.wall_desc - Returns the short description of the action.
  • action.image_url - Returns the image src of the action.
That's it! Please feel free to contact us if you have any questions.  

Feedback and Knowledge Base