Email runs everything. Mechanic sends email. So long as you're sending transactional email only, you're covered. 👌

Read more: What kind of email can I send with Mechanic?

The email action type accepts these options:

  • The recipient (including CC and BCC)
  • The subject
  • The body
  • Reply to
  • The sender display name
  • The name of an email template to use (see our tutorial: Add an email template)
  • A set of attachments

By default, the sender email address will look like this (assuming a Shopify account domain at my-fantastic-shop.myshopify.com):

my-fantastic-shop@mail.usemechanic.com 

To change this to an email address of your own, there are a couple quick steps to take. Learn more here.

For developers

Options

  • "to" – required
  • "cc" – optional
  • "bcc" – optional
  • "subject" – required
  • "body" – required; allows HTML and CSS
  • "reply_to" – optional
  • "from_display_name"  – optional; will be combined with the shop's assigned sender address
  • "template" – defaults to "default"; used to specify an email template from the store's Mechanic settings
  • "attachments" – optional; an object of file names and file values

Attachments

Mechanic will auto-detect file types based on file names, and attach them appropriately. For example, to attach a simple CSV, use this:

"attachments": {
  "simple.csv": "Question,Answer\nIs it simple?,Yes"
}

Mechanic also supports generating richer file types, like PDFs and zip files. Read more: Generating files

Examples

{
  "action": {
    "type": "email",
    "options": {
      "to": "hello@example.com",
      "subject": "Hello world",
      "body": "It's a mighty fine day!",
      "reply_to": {{ shop.customer_email | json }},
      "from_display_name": {{ shop.name | json }}
    }
  }
}

This example hard-codes the recipient, the subject, and the body. It then uses your shop's customer service email as the "reply-to" header, and uses the shop's own name as the display name for the "from" header.

Try using Liquid filters to make using captured values easy:

{% capture email_body %}
  <b>Hello!</b>

  It's fantastic to see you!
{% endcapture %}

{
  "action": {
    "type": "email",
    "options": {
      "to": "hello@example.com",
      "subject": "Hello world",
      "body": {{ email_body | unindent | strip | newline_to_br | json }}
    }
  }
}

Did this answer your question?