#383 — Send Branded Invoice Email with Payment Link
Repo: Twill-AI/facade State: open | Status: open Assignee: Unassigned
Created: 2025-07-01 · Updated: 2025-09-15
Description
Trigger branded invoice email with a payment link when a merchant chooses “Send Invoice by Email” from the UI. • Input validation: Ensure customer is selected, throw error otherwise • Fetch branding and customer email via merchant_id and customer_id • Generate payment link using PayEngine with input fields: • amount, order_id, description • Populate HTML template with: • Merchant logo, DBA name, description, amount, order ID • “Pay Now” button linking to the payment URL • Contact info in footer • Use SendGrid to send email from no-reply@twillpayments.com with subject Invoice from {{merchant.dba}}
In order to send payment links to customers of TwillAI users we need to update /integrations/{integration_id}/paymentlinks API to send emails from configured in SendGrid email address (with “on behalf of” logic using email provided per tenant, see https://github.com/Twill-AI/facade/issues/387) to the specified customer email.
AC:
-
/integrations/{integration_id}/paymentlinksAPI contains newsend_tofield to enable UI to specify email address to send email to. Ifsend_towas provided then send email from “notificatinos@twillpayments.com” (or other, see https://twill-network.slack.com/archives/C06UCQP1BFC/p1752053535984289) on behalf of provided per-tenant support email with all actions explained inhttps://github.com/Twill-AI/twill-iac/issues/110 and return relevant information (need to be found during implementation) in API response. - There are logs allowi
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets