Skip to main content

Email & SMS Marketing

Scottsdale Mint uses three platforms for customer communication:

PlatformPurpose
KlaviyoEmail marketing, behavioral flows, segmentation
AttentiveSMS/text message marketing
MailgunTransactional 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 Checkout events
  • Syncs product catalog to Klaviyo

Environment Variablesโ€‹

VariableDescription
KLAVIYO_PUBLIC_API_KEYKlaviyo public API key (site ID) โ€” used in frontend JS
KLAVIYO_PRIVATE_API_KEYKlaviyo private API key โ€” server-side only
info

The Klaviyo public key is safe to expose in frontend JavaScript. The private key must never appear in frontend code.

Key Events Trackedโ€‹

Event NameTrigger
Placed OrderWooCommerce order completed
Ordered ProductPer line item in completed order
Started CheckoutCustomer began checkout
Viewed ProductCustomer viewed a product page
Product Back in StockCustom 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โ€‹

VariableDescription
ATTENTIVE_SITE_IDAttentive 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โ€‹

SettingValue
Mail Serversmtp.mailgun.org
Port587 (STARTTLS)
From Email[email protected]
From NameScottsdale Mint

Environment Variablesโ€‹

VariableDescription
MAILGUN_API_KEYMailgun API key
MAILGUN_DOMAINMailgun 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.com on behalf of Mailgun
  • Unsubscribe links are managed by Klaviyo (for marketing) and Mailgun (for transactional)
  • Hard bounces are processed by Mailgun's suppression list
Do Not Test Transactional Emails in Production

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.