Send a follow-up email to customers after purchasing from a certain vendor
This task will send a follow-up email to your customer after their order is paid, waiting for a configurable number of days before doing so.
Try this taskWhen it runs
Occurs whenever an order is created
What you choose
- Product vendor
- Email subject
- Email body
- Number of days to wait before sending email
Documentation
This task will send a follow-up email to your customer after their order is paid, waiting for a configurable number of days before doing so.
This task will send a follow-up email to your customer after their order is paid. Configure it with the name of the vendor to watch for. The vendor name is case-sensitive!
Task code and subscriptions
You can edit the Liquid code after installing this task. View on GitHub or ask a question in the Mechanic Slack community.
Subscriptions
shopify/orders/create{% if options.number_of_days_to_wait_before_sending_email__number != blank %}+{{ options.number_of_days_to_wait_before_sending_email__number }}.days{% endif %}
How task subscriptions work
Option types and flags
- Product vendor (required)
- Email subject (required)
- Email body (required, multiline)
- Number of days to wait before sending email (number)
Task code
{% assign order_qualifies = true %}
{% assign order_vendors = order.line_items | map: "vendor" | uniq %}
{% unless order_vendors contains options.product_vendor__required %}
{% assign order_qualifies = false %}
{% endunless %}
{% if order.email == blank %}
{% assign order_qualifies = false %}
{% endif %}
{% if order.reload.cancelled_at != blank %}
{% assign order_qualifies = false %}
{% endif %}
{% if event.preview or order_qualifies %}
{% action "email" %}
{
"to": {{ order.email | json }},
"subject": {{ options.email_subject__required | json }},
"body": {{ options.email_body__required_multiline | strip | newline_to_br | json }},
"reply_to": {{ shop.customer_email | json }},
"from_display_name": {{ shop.name | json }}
}
{% endaction %}
{% endif %}
Mechanic Liquid reference
Default option values
- Email subject
Following up on your order ({{ order.name }})- Email body
Hello, Thanks for ordering a (add your vendor!) product from {{ shop.name }}! Here's some important information you need to know... Thanks, {{ shop.name }}