Get email alerts for FBA failures, with Mechanic.

Mechanic is a development and ecommerce automation platform for Shopify. :)

Get email alerts for FBA failures

Using Fulfillment By Amazon for your business? Stay on top of your customer experience by getting notified whenever FBA is unable to fulfill your order.

Runs Occurs whenever a fulfillment is created and Occurs whenever a fulfillment is updated. Configuration includes email recipient, email subject, and email body.

15-day free trial – unlimited tasks

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Shopifolks, everybody.

That’s why we make it easy to configure automation without code, why we make it easy to tweak the underlying code once tasks are installed, and why we publish it all here for everyone to learn from.

(By the way, have you seen our documentation? Have you joined the Slack community?)

Open source
View on GitHub to contribute to this task
Subscriptions
shopify/fulfillments/create
shopify/fulfillments/update
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
email recipient (email, required), email subject (required), email body (multiline, required)
Code
{% assign cache_key = "fulfillment-failure-email-sent-" | append: fulfillment.id %}
{% assign order_qualifies = false %}

{% if fulfillment.service == "amazon_marketplace_web" and fulfillment.status == "failure" and cache[cache_key] != true %}
  {% assign order_qualifies = true %}
{% endif %}

{% if order_qualifies or event.preview %}
  {
    "action": {
      "type": "email",
      "options": {
        "to": {{ options.email_recipient__email_required | 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 }}
      }
    }
  }

  {
    "action": {
      "type": "cache",
      "options": {
        "set": {
          "key": {{ cache_key | json }},
          "value": true
        }
      }
    }
  }
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more
Defaults
Email subject
FBA failure for order {{ fulfillment.order.name | default: "#12345" }}
Email body
Hello,

Amazon has reported a fulfillment failure for order {{ fulfillment.order.name | default: "#12345" }}. Here's the message they included:

> {{ fulfillment.receipt.response_message | default: "(no message given)" }}

View this order's details in Shopify:

https://{{ shop.myshopify_domain }}/admin/orders/{{ fulfillment.order.id | default: 12345 }}

Thanks,

- Mechanic, for {{ shop.name }}