fix(newsletter): email rendering bugs and unsubscribe confirmation #78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "exe-dev-bot/market:fix/newsletter-email-bugs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes several bugs in the weekly newsletter email and the unsubscribe page.
Changes
Email rendering fixes (
src/lib/newsletter-email.ts)/items/{id}, vendors link to/v/{vendor_id}. Footer links (Privacy Policy, Content Policy) also made absolute usingsiteUrl.<div>with DiceBear SVG (https://api.dicebear.com/7.x/initials/svg?seed=...), consistent with the in-browser newsletter.Delivery pipeline (
src/lib/newsletter-delivery.ts)siteUrltorenderNewsletterEmail()for absolute link generation.Unsubscribe confirmation (
src/pages/newsletter/unsubscribe.astro)/my/settings→/profile/edit(the actual page where newsletter opt-in lives).Testing
POST /api/newsletter/trigger) and verify:/profile/edit(not/my/settings)- Wrap items in <a href="${siteUrl}/items/${id}"> and vendors in <a href="${siteUrl}/v/${vendor_id}"> with color:inherit styling - Add siteUrl parameter to renderNewsletterEmail and pass it from newsletter-delivery.ts processUser; also fix footer policy links to use absolute URLs - Replace inline div initials fallback with DiceBear initials SVG img tag to match the in-browser view - Add itemType parameter to renderItem; for buy items, hide the price line entirely when price_string is falsy instead of showing "Price not listed" Co-authored-by: Shelley <shelley@exe.dev>