Email Echo Bot

Send an email to stevekrouse.emailEcho@valtown.email and it will send it back to you!

Readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { thisEmail } from "https://esm.town/v/stevekrouse/thisEmail";
import { mail } from "https://esm.town/v/stevekrouse/mail";
export const emailEcho = function (email: Email) {
return mail({
to: email.from,
from: thisEmail(),
subject: "Re: " + email.subject,
text: email.text,
html: email.html,
});
};
interface Email {
from: string;
to: string[];
subject: string;
text: string;
html: string;
}
👆 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.