import { email } from "https://esm.town/v/std/email?v=9";
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
);
return response.json();
}
const randomJoke = await fetchRandomJoke();
const setup = randomJoke.setup;
const punchline = randomJoke.punchline;
export const emailRandomJoke = email({
text: punchline,
subject: setup,
});
export function forwarder(e: {
from: "tejchak04@gmail.com";
to: "chakravarthy.t@northeastern.edu";
subject: "joke";
text: "joke";
html: "chakravarthy.t@northeastern.edu";
}) {
console.email({ html: e.html, subject: e.subject });
}