Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Val Town Inspiration Email

Get inspired by what's possible to make on Val Town.

The list is here: https://www.val.town/v/stevekrouse/valTownInspoList. Pull requests welcome!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { email } from "https://esm.town/v/std/email";
import { valTownInspoList } from "https://esm.town/v/stevekrouse/valTownInspoList";
export const valTownInspirationEmail = async () => {
let subject = "Daily Val Town inspiration";
let valTownInspo = valTownInspoList[
Math.floor(
Math.random() * valTownInspoList.length,
)
];
let html = `<h1>${valTownInspo.title}</h1>
<p>${valTownInspo.description}</p>
<a href="https://val.town/${valTownInspo.val}"><img src="${valTownInspo.image}" style="max-width:576px"/></a>
<p><a href="https://www.val.town/settings/intervals">Unsubscribe here</a></p>`;
email({ html, subject });
};
September 12, 2024