Shopify

Connect Shopify webhooks and storefront events to MailSetu with the included starter kit.

Use the starter kit

The repo includes a Shopify starter integration under `integrations/shopify/`. It gives you a small wrapper for order emails, fulfillment updates, and OTP-style SMS from a custom app backend.

bash
# Example structure
integrations/shopify/mailsetu-shopify.js
integrations/shopify/README.md

Initialize the client in your custom app

javascript
import { createMailSetuShopify } from './integrations/shopify/mailsetu-shopify.js'

const mailsetu = createMailSetuShopify({
  apiKey: process.env.MAILSETU_API_KEY,
  from: 'orders@yourstore.com',
  smsApiKey: process.env.MAILSETU_SMS_KEY,
})

Use Shopify webhooks

Register `orders/create`, `orders/fulfilled`, and `checkouts/update` webhooks in your Shopify app. On each webhook, call the helper to send an email or SMS via MailSetu.

javascript
await mailsetu.sendOrderConfirmation(order)
await mailsetu.sendFulfillmentUpdate(fulfillment)
await mailsetu.sendAbandonedCheckoutReminder(checkout)