Email & SMS Marketing
Scottsdale Mint uses three platforms for customer communication:
| Platform | Purpose |
|---|---|
| Klaviyo | Email marketing, behavioral flows, segmentation |
| Attentive | SMS/text message marketing |
| Mailgun | Transactional emails (order confirmations, shipping, etc.) |
Klaviyoโ
Klaviyo is the primary email marketing platform. It is used for:
- Abandoned cart emails
- Back-in-stock alerts
- Welcome series (new subscribers)
- Post-purchase follow-up
- Spot price alerts (price drop campaigns)
- Promotional campaigns
Integrationโ
The custom back-in-stock-klaviyo plugin handles back-in-stock notification subscriptions and triggers. See Back in Stock Plugin for details.
Klaviyo is also integrated at the WooCommerce level via the Klaviyo for WooCommerce plugin, which:
- Syncs customer purchase history to Klaviyo profiles
- Fires
Placed Order,Ordered Product,Started Checkoutevents - Syncs product catalog to Klaviyo
Environment Variablesโ
| Variable | Description |
|---|---|
KLAVIYO_PUBLIC_API_KEY | Klaviyo public API key (site ID) โ used in frontend JS |
KLAVIYO_PRIVATE_API_KEY | Klaviyo private API key โ server-side only |
The Klaviyo public key is safe to expose in frontend JavaScript. The private key must never appear in frontend code.
Key Events Trackedโ
| Event Name | Trigger |
|---|---|
Placed Order | WooCommerce order completed |
Ordered Product | Per line item in completed order |
Started Checkout | Customer began checkout |
Viewed Product | Customer viewed a product page |
Product Back in Stock | Custom back-in-stock plugin fires this |
Attentiveโ
Attentive powers SMS/text message marketing. Scottsdale Mint uses Attentive for:
- Promotional SMS campaigns
- Abandoned cart SMS
- Back-in-stock text alerts (opted-in subscribers)
- Order status SMS updates
Integrationโ
Attentive is integrated via their JavaScript snippet, which is embedded in the site through the suma-patches plugin:
patches/0001-Dev-updated-attentive-script-in-plugin.patch
This patch ensures the Attentive tracking script loads correctly on the WooCommerce/Lambda environment without conflicts.
The Attentive snippet collects:
- User identity (via hashed email)
- Purchase events
- Browse events
Attentive flows and campaigns are managed entirely within the Attentive platform โ no server-side WordPress integration is required for standard use.
Environment Variablesโ
| Variable | Description |
|---|---|
ATTENTIVE_SITE_ID | Attentive site identifier (in JS snippet) |
Mailgunโ
Mailgun is the SMTP provider for all transactional emails sent by WordPress:
- Order confirmation emails
- Shipping confirmation emails
- Password reset emails
- Admin WooCommerce notifications
- All other
wp_mail()calls
Mailgun is configured via the WP Mail SMTP plugin.
Configurationโ
| Setting | Value |
|---|---|
| Mail Server | smtp.mailgun.org |
| Port | 587 (STARTTLS) |
| From Email | [email protected] |
| From Name | Scottsdale Mint |
Environment Variablesโ
| Variable | Description |
|---|---|
MAILGUN_API_KEY | Mailgun API key |
MAILGUN_DOMAIN | Mailgun sending domain (scottsdalemint.com) |
Email Routingโ
All wp_mail() calls (including WooCommerce order emails and custom suma-woo-emails) go through Mailgun regardless of the recipient address.
Email Deliverability Considerationsโ
To ensure deliverability:
- SPF, DKIM, and DMARC DNS records are configured for
scottsdalemint.comon behalf of Mailgun - Unsubscribe links are managed by Klaviyo (for marketing) and Mailgun (for transactional)
- Hard bounces are processed by Mailgun's suppression list
Testing order confirmation emails in production can trigger real Klaviyo flows and real Mailgun API calls. Use the staging environment for email testing โ the staging Mailgun domain is separate.