From d4648a44bcd81609b4ed4a8be1912c34d64ca534 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 2 Jan 2024 08:00:52 -0500 Subject: [PATCH] updated at 2024-01-02T08:00:52-05:00 --- core | 2 +- .../lib/configureSendGridNotifier.ts | 40 ++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/core b/core index a5544b9..f079d4b 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit a5544b9b0158c59e65b6e2ffac00554fd04aba97 +Subproject commit f079d4b3402334b2e4f882025a6920778efc050f diff --git a/ext/app/gen-server/lib/configureSendGridNotifier.ts b/ext/app/gen-server/lib/configureSendGridNotifier.ts index 645b238..8b8a4ec 100644 --- a/ext/app/gen-server/lib/configureSendGridNotifier.ts +++ b/ext/app/gen-server/lib/configureSendGridNotifier.ts @@ -1,7 +1,45 @@ import {HomeDBManager} from 'app/gen-server/lib/HomeDBManager'; -import {Notifier, SendGridConfig} from 'app/gen-server/lib/Notifier'; +import {Notifier} from 'app/gen-server/lib/Notifier'; +import {SendGridConfig} from 'app/gen-server/lib/NotifierTypes'; import {GristServer} from 'app/server/lib/GristServer'; +/** + * Stub SendGrid config. Actual values will be pulled from config.json + * if available. + */ +export const SENDGRID_CONFIG: SendGridConfig = { + address: { + from: { + email: 'support@example.com', + name: 'Replace This', + }, + }, + template: { + invite: 'sendgrid-template-id', + billingManagerInvite: 'sendgrid-template-id', + memberChange: 'sendgrid-template-id', + trialPeriodEndingSoon: 'sendgrid-template-id', + twoFactorMethodAdded: 'sendgrid-template-id', + twoFactorMethodRemoved: 'sendgrid-template-id', + twoFactorPhoneNumberChanged: 'sendgrid-template-id', + twoFactorEnabled: 'sendgrid-template-id', + twoFactorDisabled: 'sendgrid-template-id', + }, + list: { + singleUserOnboarding: 'sendgrid-list-id', + appSumoSignUps: 'sendgrid-list-id-unused', + trial: 'sendgrid-list-id-unused', + }, + field: { + callScheduled: 'xx_N', + userRef: 'xx_T', + }, + unsubscribeGroup: { + invites: 99998, + billingManagers: 99999, + }, +}; + export function configureSendGridNotifier(dbManager: HomeDBManager, gristConfig: GristServer) { if (!process.env.SENDGRID_API_KEY) { return undefined; }