Skip to content

Commit

Permalink
updated at 2024-01-02T08:00:52-05:00
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfitz committed Jan 2, 2024
1 parent dcfd107 commit d4648a4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
40 changes: 39 additions & 1 deletion ext/app/gen-server/lib/configureSendGridNotifier.ts
Original file line number Diff line number Diff line change
@@ -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; }

Expand Down

0 comments on commit d4648a4

Please sign in to comment.