Greeting cards
Write a card in Studio, pick the day, and it goes out by email on that day: once, or every year on a birthday. Cards are optional and off by default; a site without them works exactly the same.
The address book and the cards are kept in your site's private Supabase project, never in your repository or on a page, so a public site can hold them. A small hosted function sends each card when its time comes, even when your computer and the editor are off (ADR 0411).
Writing a card#
Open Cards in Studio (#/cards).
- Add the people you send cards to under Address book: a name, an email address, and a birthday if you'd like birthday cards.
- Choose Write a card, then who it's for and which card (Birthday, Christmas, Thanksgiving, Easter, Valentine, Anniversary, Congratulations, Thinking of you, Just because).
- Write your message.
{name}becomes their first name and{age}how old they're turning. Sign it. - Pick the day and time. For a birthday card to someone with a birthday on file, the day is filled in and Send it every year is ticked.
- See the card shows it as it will arrive. Send me a test sends it to your own address.
- Schedule this card.
Your cards lists every card with when it goes out, in words. A card that couldn't be sent says why; open it and schedule it again. Stop sending it cancels a card.
Setting it up#
You need the same free hosted pieces as hosted comments (a Supabase project and a Netlify site running open.blog's functions) and a free Brevo account. Brevo's free plan sends up to 300 emails a day and adds a small "Sent with Brevo" line.
-
In Supabase, open SQL Editor and run
supabase/greetings.sql. -
In Brevo, add and verify your sender address (Senders, domains & dedicated IPs → Senders), then create an API key (SMTP & API → API keys).
-
In Netlify, set these environment variables and redeploy:
Variable Value OPENBLOG_GREETINGS_ENABLEDtrueOPENBLOG_GREETINGS_ADMIN_KEYA long random value (32 characters or more) BREVO_API_KEYThe Brevo API key OPENBLOG_GREETINGS_FROMThe verified sender, like Grammi <grammi@example.com>OPENBLOG_GREETINGS_TIME_ZONEYour time zone, like America/New_York(the default)OPENBLOG_SITE_NAMEOptional: your site's name, shown at the foot of each card with a link SUPABASE_URL,SUPABASE_SECRET_KEY,OPENBLOG_SITE_ID,OPENBLOG_SITE_ORIGINandOPENBLOG_SITE_BASE_PATHare the ones hosted comments already use. -
Where Admin runs, set
OPENBLOG_GREETINGS_ENDPOINTtohttps://<your-netlify-site>/api/greetingsandOPENBLOG_GREETINGS_ADMIN_KEYto the same key, then restart Admin. Greeting cards appears in the menu.
The hourly sender (greetings-send) is a Netlify scheduled function; it does nothing until greeting cards
are switched on. To remove everything, export the two tables and run
supabase/greetings-rollback.sql.