ai cooking
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use seasonal brand colors in mail template (#246)

authored by

Paul Miller and committed by
GitHub
3264e8da d4ab0fc4

+11 -9
+2
internal/recipes/html.go
··· 111 111 Hash string 112 112 Recipes []ai.Recipe 113 113 Domain string 114 + Style seasons.Style 114 115 }{ 115 116 Location: *p.Location, 116 117 Date: p.Date.Format("2006-01-02"), 117 118 Hash: p.Hash(), 118 119 Recipes: l.Recipes, 119 120 Domain: "https://careme.cooking", 121 + Style: seasons.GetCurrentStyle(), 120 122 } 121 123 122 124 return templates.Mail.Execute(writer, data)
+9 -9
internal/templates/mail.html
··· 5 5 <meta name="viewport" content="width=device-width, initial-scale=1" /> 6 6 <title>Careme Recipes</title> 7 7 </head> 8 - <body style="margin:0; padding:0; background-color:#fff7ed; -webkit-text-size-adjust:100%; font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif; color:#111827;"> 8 + <body style="margin:0; padding:0; background-color:{{.Style.Colors.C50}}; -webkit-text-size-adjust:100%; font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif; color:#111827;"> 9 9 <main style="padding:40px 16px;"> 10 10 <section style="margin:0 auto; width:100%; max-width:800px;"> 11 - <div style="border-radius:16px; border:1px solid #ffedd5; background-color:rgba(255,255,255,0.9); box-shadow:0 10px 25px rgba(15,23,42,0.08);"> 12 - <div style="border-bottom:1px solid #ffedd5; padding:32px 32px 24px 32px;"> 13 - <h1 style="margin:0; font-size:32px; line-height:1.1; font-weight:800; letter-spacing:-0.02em; color:#c2410c;"> 14 - <a href="{{.Domain}}/recipes?h={{.Hash}}" style="text-decoration:none; color:#c2410c;"> Careme Recipes Mail</a> 11 + <div style="border-radius:16px; border:1px solid {{.Style.Colors.C100}}; background-color:rgba(255,255,255,0.9); box-shadow:0 10px 25px rgba(15,23,42,0.08);"> 12 + <div style="border-bottom:1px solid {{.Style.Colors.C100}}; padding:32px 32px 24px 32px;"> 13 + <h1 style="margin:0; font-size:32px; line-height:1.1; font-weight:800; letter-spacing:-0.02em; color:{{.Style.Colors.C700}};"> 14 + <a href="{{.Domain}}/recipes?h={{.Hash}}" style="text-decoration:none; color:{{.Style.Colors.C700}};"> Careme Recipes Mail</a> 15 15 </h1> 16 16 <p style="margin:8px 0 0 0; font-size:14px; color:#4b5563;"> 17 17 Location: 18 - <span style="font-weight:600; color:#c2410c;">{{.Location.Name}}</span> 18 + <span style="font-weight:600; color:{{.Style.Colors.C700}};">{{.Location.Name}}</span> 19 19 <span style="font-size:12px; color:#6b7280;"> ({{.Location.Address}})</span> 20 20 </p> 21 21 {{if .Date}} 22 22 <p style="margin:4px 0 0 0; font-size:12px; color:#6b7280;"> 23 - Week of <span style="font-weight:600; color:#c2410c;">{{.Date}}</span> 23 + Week of <span style="font-weight:600; color:{{.Style.Colors.C700}};">{{.Date}}</span> 24 24 </p> 25 25 {{end}} 26 26 </div> ··· 28 28 <div style="padding:24px 32px 32px 32px;"> 29 29 <div style="margin-top:16px;"> 30 30 {{range .Recipes}} 31 - <article style="margin-bottom:24px; border-radius:16px; border:1px solid #ffedd5; background-color:rgba(255,255,255,0.95); padding:24px; box-shadow:0 6px 16px rgba(15,23,42,0.05);"> 31 + <article style="margin-bottom:24px; border-radius:16px; border:1px solid {{$.Style.Colors.C100}}; background-color:rgba(255,255,255,0.95); padding:24px; box-shadow:0 6px 16px rgba(15,23,42,0.05);"> 32 32 <header style="margin-bottom:12px;"> 33 33 <div> 34 34 <a href="{{$.Domain}}/recipe/{{.ComputeHash}}" 35 - style="font-size:20px; font-weight:600; color:#c2410c; text-decoration:none;"> 35 + style="font-size:20px; font-weight:600; color:{{$.Style.Colors.C700}}; text-decoration:none;"> 36 36 {{.Title}} 37 37 </a> 38 38 <p style="margin:4px 0 0 0; font-size:13px; color:#6b7280;">