Readme

Val Town email subscriptions: newsletter reminder

Cousin Val to @petermillspaugh/emailSubscription for emailing yourself a reminder to send your next newsletter.

Since this Val is public, anyone can run it. I've commented out the function body that actually emails me to prevent anyone from spamming me, but you can fork this as a private Val to set a cron reminder.

1
2
3
4
5
6
7
8
9
import { newsletters } from "https://esm.town/v/petermillspaugh/newsletters";
import { email } from "https://esm.town/v/std/email?v=11";
export async function sendNewsletterReminder(interval: Interval) {
// await email({
// subject: `Reminder to prepare newsletter #${newsletters.length + 1}`,
// html: `One week left to write up the next newsletter!`,
// });
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.