Skip to content

Commit 6ce37bd

Browse files
committed
fix(email): Updating test send script, using correct collection, removing unused text component for now, adding logging
1 parent 6e10fad commit 6ce37bd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

scripts/firebase-admin/sendTestEmail.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ const renderToHtmlString = (digestData: NotificationEmailDigest) => {
5757

5858
const Args = Record({ email: String })
5959

60+
// Send a test email with:
61+
// yarn firebase-admin -e dev run-script sendTestEmail --email="[email protected]"
6062
export const script: Script = async ({ db, args }) => {
6163
const { email } = Args.check(args)
6264
const digestData: NotificationEmailDigest = {
@@ -71,14 +73,18 @@ export const script: Script = async ({ db, args }) => {
7173

7274
const htmlString = renderToHtmlString(digestData)
7375

76+
console.log("DEBUG: HTML String: ", htmlString)
77+
console.log("DEBUG: Email: ", email)
78+
7479
// Create an email document in /notifications_mails to queue up the send
75-
await db.collection("notifications_mails").add({
80+
const result = await db.collection("emails").add({
7681
to: [email],
7782
message: {
7883
subject: "Test Notifications Digest",
79-
text: "", // blank because we're sending HTML
8084
html: htmlString
8185
},
8286
createdAt: Timestamp.now()
8387
})
88+
89+
console.log("DEBUG: Email document created with ID: ", result.id)
8490
}

0 commit comments

Comments
 (0)