Email customers after purchasing a certain product
Send an email to the customer with specific information regarding a product they just purchased. Useful for digital products, or anytime you'd like to communicate something extra about a product you offer. (Note: this does not replace the Shopify order confirmation email!)
Try this taskWhen it runs
Occurs whenever an order is created
What you choose
- Email subject
- Email body
- Product SKU
- Days to wait before emailing
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.days_to_wait_before_emailing__number != blank %}+{{ options.days_to_wait_before_emailing__number }}.days{% endif %}
How task subscriptions work
Option types and flags
- Email subject (required)
- Email body (multiline, required)
- Product SKU (required)
- Days to wait before emailing (number)
Task code
{% capture email_action %}
{
"action": {
"type": "email",
"options": {
"to": {{ order.email | json }},
"subject": {{ options.email_subject__required | json }},
"body": {{ options.email_body__multiline_required | strip | newline_to_br | json }},
"reply_to": {{ shop.customer_email | json }},
"from_display_name": {{ shop.name | json }}
}
}
}
{% endcapture %}
{% if event.preview %}
{{ email_action }}
{% else %}
{% for line_item in order.line_items %}
{% if line_item.sku == options.product_sku__required %}
{{ email_action }}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
Mechanic Liquid reference