A Shopify app that integrates Veil Mail for secure transactional and marketing emails — with automatic PII protection, CASL compliance, and abandoned cart recovery.
Use this if you run a Shopify store and want secure, compliant transactional and marketing email without relying on Klaviyo, SendGrid, or Shopify Email. Veil Mail automatically scans every email for PII (credit cards, customer data), enforces CASL/GDPR compliance on marketing sends, and handles order confirmations, shipping notifications, customer sync, and abandoned cart flows — all from one platform.
Related: Veil Mail product · Node.js SDK · Docs
- Order Emails - Automatic order confirmation, shipping, and delivery notifications
- Customer Sync - Sync Shopify customers to Veil Mail audiences
- Abandoned Cart Recovery - Send automated emails to recover lost sales
- PII Protection - Automatic masking of sensitive customer data
- Bun 1.1+
- Shopify Partner account
- Veil Mail account
- Install dependencies
cd integrations/shopify
bun install- Set up the database
bun run prisma generate
bun run prisma db push- Configure environment
Create a .env file:
SHOPIFY_API_KEY=your_api_key
SHOPIFY_API_SECRET=your_api_secret
SHOPIFY_APP_URL=https://your-tunnel-url.ngrok.io
SCOPES=read_customers,write_customers,read_orders,write_orders,read_products
DATABASE_URL=postgresql://user:password@localhost:5432/veil_mail_shopify- Start development server
bun run devThis will start the Shopify CLI dev server which handles:
- ngrok tunnel for OAuth
- App installation flow
- Hot reloading
integrations/shopify/
├── app/
│ ├── routes/
│ │ ├── app._index.tsx # Dashboard
│ │ ├── app.settings.tsx # Settings page
│ │ ├── app.templates.tsx # Email templates (TODO)
│ │ ├── app.logs.tsx # Email logs (TODO)
│ │ └── webhooks.tsx # Webhook handlers
│ ├── services/
│ │ └── veil.server.ts # Veil Mail API client
│ ├── shopify.server.ts # Shopify app configuration
│ └── db.server.ts # Prisma client
├── prisma/
│ └── schema.prisma # Database schema
├── shopify.app.toml # Shopify app configuration
└── package.json
The app listens for these Shopify webhooks:
| Webhook | Action |
|---|---|
customers/create |
Sync new customer to Veil Mail |
customers/update |
Update customer in Veil Mail |
orders/create |
Send order confirmation email |
orders/fulfilled |
Send shipping notification |
orders/cancelled |
Send cancellation email |
checkouts/create |
Track for abandoned cart |
checkouts/update |
Update abandoned cart tracking |
app/uninstalled |
Clean up store data |
-
Install Fly CLI:
brew install flyctl -
Create app:
fly launch- Set secrets:
fly secrets set SHOPIFY_API_KEY=xxx
fly secrets set SHOPIFY_API_SECRET=xxx
fly secrets set DATABASE_URL=xxx- Deploy:
fly deployThe app can be deployed to any Node.js hosting platform:
- Railway
- Render
- Heroku
- Cloud Run
Before submitting to the Shopify App Store:
- Complete all required app listing information
- Add privacy policy and terms of service URLs
- Test app installation/uninstallation flow
- Verify all webhooks are working
- Test with multiple stores
- Review Shopify's app requirements
MIT - Copyright (c) 2025-present Resonia Inc