package templates import ( "bytes" "html/template" ) // ─── Centralized Business Details ──────────────────────────────── // Update these constants to change the branding and legal info // across all email templates. const ( CompanyName = "Warmbly" LegalEntity = "Mindroot Ltd" CompanyNumber = "00000000" PlaceOfReg = "England and Wales" RegisteredAddr = "1 Example Street, London, W1A 1AA" WebsiteURL = "https://warmbly.com" AppURL = "https://app.warmbly.com" SupportEmail = "support@warmbly.com" TermsURL = "https://warmbly.com/terms" PrivacyURL = "https://warmbly.com/privacy" ) type baseData struct { Subject string Content template.HTML CompanyName string LegalEntity string CompanyNumber string PlaceOfReg string RegisteredAddr string WebsiteURL string TermsURL string PrivacyURL string } var baseTmpl = template.Must(template.New("base").Parse(baseHTML)) func renderEmail(subject, content string) (string, error) { data := baseData{ Subject: subject, Content: template.HTML(content), CompanyName: CompanyName, LegalEntity: LegalEntity, CompanyNumber: CompanyNumber, PlaceOfReg: PlaceOfReg, RegisteredAddr: RegisteredAddr, WebsiteURL: WebsiteURL, TermsURL: TermsURL, PrivacyURL: PrivacyURL, } var buf bytes.Buffer if err := baseTmpl.Execute(&buf, data); err != nil { return "", err } return buf.String(), nil } // Dashboard-style transactional email shell. // // Replaces the previous radial-blue-gradient marketing-y design with // the same chrome the user sees in the dashboard: // - clean cream background (#f5f6f8), // - white card with a hairline #e2e8f0 border, // - slate type, no fancy gradients, // - slate-900 logo monogram, no decorative haze. const baseHTML = ` {{.Subject}}
{{.CompanyName}}
{{.Content}}
Privacy  ·  Terms  ·  warmbly.com
© {{.LegalEntity}} · {{.CompanyNumber}} · {{.PlaceOfReg}}
{{.RegisteredAddr}}
`