Send account invites to all customers in bulk with Mechanic.

Mechanic is the one-tool-does-it-all automation app for Shopify. :)

Send account invites to all customers in bulk

by Isaac Bowen (team@usemechanic.com)

Use this task to send out account invitations to all the customers you already have on file, with the push of a button.

Runs when a user triggers the task. Configuration includes invitation email subject and invitation email body.

15-day free trial – unlimited tasks

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Gurus, 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.

Events
when a user triggers the task (mechanic/user/trigger)
Options
invitation email subject (required), invitation email body (multiline, required)
Script
{% for customer in shop.customers %}
  {% 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 %}
{% endfor %}
Mechanic tasks are written in Liquid, which makes them easy to write and easy to modify. Learn more about our platform.