#638 — Dynamic Email Template Rendering

Repo: Twill-AI/facade State: closed | Status: done Assignee: nadddder, sparsh-twillpayments

Created: 2025-10-08 · Updated: 2025-11-04

Description

Update email templates and SendGridProxy to dynamically render partner branding (logo, colors, company name) based on partner configuration.

  • Email templates updated with Jinja2 variables:

    • {{partner_logo}} - Partner logo URL
    • {{partner_name}} - Partner company name
    • {{partner_primary_color}} - Primary brand color
    • {{partner_secondary_color}} - Secondary brand color
  • SendGridProxy.send_email_to_merchant_rep() updated:

    • Accepts partner_id parameter
    • Loads partner_whitelabel_config from database
    • Injects partner branding into template variables
    • Uses partner’s from_email if email config authenticated
    • Falls back to Twill branding if no config
  • SendGridProxy.send_status_update_email() updated similarly

  • All email sending functions pass partner_id

  • Template rendering tested with partner branding

  • Emails display correctly in email clients (Gmail, Outlook)

  • Fallback to Twill branding works when partner config missing

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets