1export default async function (email: Email) {
2 console.log(email)
3}
3import { email } from "https://esm.town/v/std/email?v=11";
4
5export default async function(req: Request): Promise<Response> {
6 const searchParams = new URL(req.url).searchParams;
7 const { key, subject, text } = Object.fromEntries(searchParams.entries());
6
7/** This doesnt work well */
8export async function powderNotify(location: string) {
9 const weather = await getWeather(location);
10
17}
18
19export function generateLessonHtml({ email, lesson, title, fillBlank, content, quiz }: GenerateLessonHtmlParams) {
20 const lessonJsx = (
21 <html>
5type SubscriberRow = [emailAddress: string, currentLesson: number];
6
7export default async function sendDailyLessons(interval: Interval) {
8 // No-op if I accidentally click "Run now" to avoid double sending lessons
9 const now = Date.now();
10 const time23hrs57min = (23 * 60 + 57) * 60 * 1000;
11 if (!interval.lastRunAt || now - interval.lastRunAt.getTime() < time23hrs57min) {
12 console.log("Don't manually run this function! It will email all subscribers.");
13 return;
14 }
19 * The current behavior is to reset to lesson 1.
20 */
21export async function upsertStudent({ name, email, token }: UpsertEmailSubscriberParams) {
22 return sqlite.execute({
23 sql: `
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function markLessonComplete(emailAddress: string) {
4 await sqlite.execute({
5 sql: `
8}
9
10export async function sendLesson({ lesson, emailAddress }: SendLessonParams) {
11 await sqlite.execute({
12 sql: `
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createStudentsTable() {
4 await sqlite.execute(
5 `
2import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
3
4export async function unsubscribe(req: Request) {
5 const searchParams = new URL(req.url).searchParams;
6 const emailAddress = searchParams.get("email");
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.