# How to Insert Retainful's Shortcodes

Retainful enables you to personalize your emails effectively using shortcodes. For instance, you can dynamically include the customer’s name in the subject line or the body of the email by leveraging the appropriate shortcode. \
\
This enhances the relevance and engagement of your email communication.

When an email is sent to the customer, the shortcode is automatically replaced with their name, ensuring a personalized and engaging email experience.

{% hint style="success" %}
**IMPORTANT**

Shortcodes must always be enclosed with **two opening curly** and **two closing curly braces**.\
\
**Example:** `{{example_shortcode}}`
{% endhint %}

### List of Shortcodes

Here is a list of popular shortcodes that you can use in both the **Subject Lines** and **Email Body**:<br>

{% hint style="danger" %}
**Campaign & Automation**\
\
These shortcodes are only applicable in the **Campaign** and **Automation** sections of Retainful. \
\
They can be used to personalize emails and messages for enhanced customer engagement.
{% endhint %}

## Common short codes

These are common short codes that can be used in both campaigns and workflows.

### Customer Details

* **{{first\_name}}**: Displays the customer's first name.
* **{{last\_name}}**: Displays the customer's last name.
* **{{customer\_name}}**: Displays the customer's full name.
* **{{email}}**: Displays the customer's email address.
* **{{phone\_number}}**: Displays the customer's phone number.
* **{{unsubscribe\_shop\_customer\_url}}**: Displays a link that allows customers to unsubscribe from marketing emails or broadcasts.

### Shop Information

The following short codes are related to the shop. These are common to both automation workflows and campaigns.&#x20;

* **{{shop.name}}**: Displays the shop name.
* **{{shop.email}}**: Displays the shop email.
* **{{shop.currency}}**: Displays the shop currency.
* **{{shop.domain}}**: Displays the shop domain URL.
* **{{retainful\_shop\_url}}**: Displays the Retainful store URL.
* **{{retainful\_shop\_url\_with\_coupon\_code}}**: Displays the Retainful store URL with a coupon code applied.

## Campaign Short codes

In addition to the common short codes listed above, the following short codes can be used to include customer properties in your campaigns

### 1. Last Order Information

When sending a campaign, you can include the last order information.&#x20;

* **{{last\_order.order\_number}}**: Displays the order number.
* **{{last\_order.order\_date}}**: Displays the date of the order.
* **{{last\_order.order\_status}}**: Displays the current order status.
* **{{last\_order.payment\_method}}**: Displays the payment method name.
* **{{last\_order.total\_price}}**: Displays the total order price.
* **{{last\_order.subtotal\_price}}**: Displays the subtotal amount.
* **{{last\_order.total\_tax}}**: Displays the total tax.
* **{{last\_order.total\_discounts}}**: Displays the total discount amount.

### 2. Last Cart Information

You can include the last abandoned cart information in the campaign using the following short codes. It will be useful when you target customers who abandoned the cart.

* **{{last\_abandoned\_cart.abandoned\_checkout\_url}}**: Displays the recovery link for the abandoned checkout.
* **{{last\_abandoned\_cart.abandoned\_checkout\_url\_with\_coupon\_code}}**: Displays the recovery link with an applied coupon code.
* {{**last\_abandoned\_cart.total\_price}}  -** Displays the total amount of the last abandoned cart / order
* **{{last\_abandoned\_cart.subtotal\_price}}**: Displays the subtotal price of the cart.

## Automation Short codes

The following short codes can be used in the automation workflows. Please note that there are a few short codes that are specific to certain workflows.

### Common Short codes for Automation Workflows

The following short codes can be used in almost all types of workflows except the "Welcome Email Series" type.

* **{{billing\_address.name}}**: Displays the full name for the billing address.

* **{{billing\_address.address1}}**: Displays the first line of the billing address.

* **{{billing\_address.address2}}**: Displays the second line of the billing address.

* **{{billing\_address.city}}**: Displays the billing city.

* **{{billing\_address.province}}**: Displays the state/province.

* **{{billing\_address.zip}}**: Displays the postal/ZIP code.

* **{{billing\_address.country}}**: Displays the billing country.

* **{{shipping\_address.name}}**: Displays the full name for the shipping address.

* **{{shipping\_address.address1}}**: Displays the first line of the shipping address.

* **{{shipping\_address.address2}}**: Displays the second line of the shipping address.

* **{{shipping\_address.city}}**: Displays the shipping city.

* **{{shipping\_address.province}}**: Displays the state/province.

* **{{shipping\_address.zip}}**: Displays the postal/ZIP code.

* **{{shipping\_address.country}}**: Displays the shipping country.

### Abandoned Cart Workflow

The following shortcodes will work only for the abandoned cart automation

* **{{abandoned\_checkout\_url}}**: Displays the abandoned cart recovery URL.
* **{{abandoned\_checkout\_url\_with\_coupon\_code}}**: Displays the recovery URL with a coupon code applied.
* **{{retainful\_coupon\_expiry\_date | date: "%d-%m-%y %H:%M"}}:** Displays the coupon expiry date in "day-month-year hour:minute" format.

### Post Purchase Workflows - Thank you, win back, order follow up & more

The following short codes will work in all the "after purchase" workflows such as thank you emails, win back emails.

### Order Information

* **{{order\_number}}**: Displays the order number.
* **{{order\_date}}**: Displays the date of the order.
* **{{order\_status}}**: Displays the current order status.
* **{{payment\_method}}**: Displays the payment method name.
* **{{total\_price}}**: Displays the total order price.
* **{{subtotal\_price}}**: Displays the subtotal amount.
* **{{total\_tax}}**: Displays the total tax.
* **{{total\_discounts}}**: Displays the total discount amount.

{% hint style="success" %}
**Need More Help?**\
\
We’re here to make things easier for you!

* Email Us: Reach out anytime at <support@retainful.com><mark style="color:orange;">.</mark>
* Schedule a Call: Still stuck or need a hands-on walkthrough? Book a quick session with our support team, and we’ll guide you step-by-step.

[<mark style="color:blue;">**Schedule a call with us**</mark>](https://zcal.co/retainful/onboarding)<mark style="color:blue;">**.**</mark>
{% endhint %}

{% hint style="info" %}
**Need More Help in setting up Retainful?** <br>

We’re here to make things easier for you!<br>

* **Email Us:** Reach out anytime at [<mark style="color:orange;">support@retainful.com</mark>](mailto:support@retainful.com)<mark style="color:orange;">.</mark>
* **Schedule a Call:** Still stuck or need a hands-on walkthrough?

\
&#x20;[<mark style="color:orange;">**Book a quick session with our support team**</mark>](https://zcal.co/retainful/onboarding), and we’ll guide you step-by-step.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.retainful.com/how-tos/shortcodes-for-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
