Give finished Rules a print path, folded launch counts, and a two-day follow-up.
Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
This commit is contained in:
1 parent
0efc907633
commit
d9c475a967
74 files changed
+2401
-630
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildRuleFollowUpMail } from "../../lib/server/ruleFollowUpMail";
|
||||
|
||||
describe("buildRuleFollowUpMail", () => {
|
||||
const mail = buildRuleFollowUpMail({
|
||||
to: "pen@example.com",
|
||||
origin: "https://communityrule.info",
|
||||
communityName: "Juniper Street Food Share",
|
||||
pdfUrl: "https://communityrule.info/api/rules/r1/export/pdf?t=tok",
|
||||
markdownUrl: "https://communityrule.info/api/rules/r1/export/md?t=tok",
|
||||
});
|
||||
|
||||
it("uses the drawn subject, PDF button, RULE.md link, and kit pointer", () => {
|
||||
expect(mail.subject).toBe("Juniper Street Food Share’s Rule, printed");
|
||||
expect(mail.previewText).toContain("ready to print");
|
||||
expect(mail.text).toContain("Download the PDF");
|
||||
expect(mail.text).toContain(
|
||||
"https://communityrule.info/api/rules/r1/export/pdf?t=tok",
|
||||
);
|
||||
expect(mail.text).toContain("RULE.md");
|
||||
expect(mail.text).toContain("communityrule.info/kit");
|
||||
expect(mail.html).toContain("Download the PDF");
|
||||
expect(mail.html).toContain("RULE.md");
|
||||
expect(mail.html).toContain("/kit");
|
||||
expect(mail.html).not.toMatch(/tracking pixel|1x1/i);
|
||||
});
|
||||
|
||||
it("does not invent a first name", () => {
|
||||
expect(mail.html).not.toContain("Hi Maya");
|
||||
expect(mail.text).not.toContain("Hi Maya");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user