#344 — Investigate sending email options and update “Payment V1” epic with it

Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned

Created: 2025-05-09 · Updated: 2025-09-15

Description

We need to send emails for following purposes:

  1. Notification to PayEngine’s Merchant customers about Payment Links (i.e. send invoices from Twill users to theirs customers). We have a request to send emails not from ”*@twillpayments.com” but from our user’s emails, like “noreply@nari.com”. We need to be sure that email was sent to render relevant information in “Payment Link” widgets.
  2. TwillAI insights/notifications to Twill users.
  3. [may be covered by MailGun integration in PayEngine] PayEngine events to merchants (onboarding events, payment is made via the payment link, dispute events, accounting integration events, login to portal).
  4. [covered by Supabase] Authentication flow emails.

For now we have following options:

  • Direct SendGrid calls. We are using SendGrid for Supabase authentication emails already, free account. Has Python SDK.
  • Direct MailGun calls (which we probably would use in PayEngine). Provides HTTP API
  • Supabase doesn’t provide API for custom emails. Or integration would be too complex, through PostgreSQL extension which calls HTTP API.
  • PostHog doesn’t have ability to send custom emails.

For “how to mimic as tenant email” options see Slack payenginge-integration message. In short it is either direc

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets