Automatically send account invite to new customers, with Mechanic.

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

Automatically send account invite to new customers

This task keeps an eye on customers as you create or import them in Shopify, and automatically sends account invitations to any customers that have an email address.

Runs Occurs whenever a customer is created, with a 1 minute delay. Configuration includes invitation email subject and invitation email body.

15-day free trial – unlimited tasks

Documentation

This task keeps an eye on customers as you create or import them in Shopify, and automatically sends account invitations to any customers that have an email address.

This task sends account invitations to newly-created customers, whether created/imported through the Shopify admin or through another app. It does not send invitation emails for customers without an email address, or to customers who've signed up via your online store. (Wondering about the 1-minute delay? It's because customers who sign themselves up aren't marked as such until a few seconds after their account is created. So, Mechanic waits a minute, just to be sure.)

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/customers/create+1.minute
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
invitation email subject (required), invitation email body (multiline, required)
Code
{% assign customer = customer.reload %}

{% assign customer_qualifies = false %}
{% if customer.state == "disabled" and customer.email != blank %}
  {% assign customer_qualifies = true %}
{% endif %}

{% if event.preview or customer_qualifies %}
  {
    "action": {
      "type": "shopify",
      "options": [
        "post",
        "/admin/customers/{{ customer.id }}/send_invite.json",
        {
          "customer_invite": {
            "subject": {{ options.invitation_email_subject__required | json }},
            "custom_message": {{ options.invitation_email_body__multiline_required | json }}
          }
        }
      ]
    }
  }
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more