Readme

Email notifications when your vals receive comments

Setup

  1. Create a Val Town API Token
  2. Add it to your secrets as valtown
  3. Fork & Run this val
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { receivedCommentsEmail } from "https://esm.town/v/andreterron/receivedCommentsEmail";
import process from "node:process";
import { comments as comments2 } from "https://esm.town/v/andreterron/comments";
export const receivedNewComments = async (interval: Interval) => {
const comments = await comments2({
token: process.env.vt_token,
since: interval.lastRunAt,
relationship: "received",
});
if (comments?.data?.length) {
console.email({
html: receivedCommentsEmail(comments),
}, "Val Town Comments");
}
return comments;
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023