Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Track creator commissions and PDF payouts with Shopify, Google Sheets, Gmail and Slack

When a form is submitted, it handles email with OpenAI / ChatGPT using Gmail, Google Sheets, Shopify, Slack.

What it does

# Track influencer and affiliate sales, commissions and monthly payouts Who it's for: D2C brands that hand creators a discount code and then lose track of who sold what. Orders get misattributed, refunds are forgotten, and the monthly payout becomes a day of spreadsheet math. ## How it works 1. A form creates each creator's unique Shopify discount code and tracking link, then emails them both. 2. Every order that uses a code or link is matched to its creator and logged with a commission, with extra points for new customers. 3. Refunds and cancellations reduce or void that commission, or are deducted next month if it was already paid. 4. On the 2nd of each month, orders past the return window are totalled per creator with tier bonuses, clawbacks and TDS. 5. Each creator receives a PDF statement, Slack gets a leaderboard, and a Slack bot answers "what did this creator earn?" ## Setup steps 1. Create a Shopify custom app (read_orders, read_customers, write_discounts) and add its token as Header Auth on Create Shopify Code, replacing REPLACE_STORE. Connect the three Shopify triggers. 2. Connect Google Sheets, Gmail, Slack (including the app mention trigger), WhatsApp Business Cloud and OpenAI. 3. Create Creators, Affiliate Orders and Payouts tabs and replace the REPLACE_… IDs. 4. Set your store URL in Clean Form Input & Settings. 5. Run Gotenberg (docker run -p 3000:3000 gotenberg/gotenberg:8) where n8n can reach it. 6. Set this workflow as its own error workflow, then add a test creator and place a test order. ## Customization tips Return window, tier bonuses, TDS rates and the minimum payout are at the top of Statement Period & Rules.

The steps

  1. Onboard Creator Form
  2. Read Creators
  3. Clean Form Input & Settings
  4. Build Unique Code & Link
  5. Build Link & Discount Request
  6. Create Shopify Code
  7. Code Created?
  8. Post Code Failure to Slack
  9. Save Creator
  10. Email Welcome to Creator
  11. Post Onboarding to Slack
  12. On Shopify Order Created
  13. Order Fields
  14. Skip Test Orders

64 steps in total.

Similar automations