Skip to content

Commit

Permalink
refactor(functions): enable first payout email function (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkue authored May 16, 2024
1 parent 9eb7ac7 commit c906fbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions functions/src/cron/first-payout-email/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FirestoreAdmin } from '@socialincome/shared/src/firebase/admin/FirestoreAdmin';
import { toFirebaseAdminTimestamp } from '@socialincome/shared/src/firebase/admin/utils';
import { Contribution, CONTRIBUTION_FIRESTORE_PATH } from '@socialincome/shared/src/types/contribution';
import { LanguageCode } from '@socialincome/shared/src/types/language';
import { User, USER_FIRESTORE_PATH } from '@socialincome/shared/src/types/user';
import { toDateTime } from '@socialincome/shared/src/utils/date';
import { FirestoreAdmin } from '../../../../shared/src/firebase/admin/FirestoreAdmin';
import { toFirebaseAdminTimestamp } from '../../../../shared/src/firebase/admin/utils';
import { Contribution, CONTRIBUTION_FIRESTORE_PATH } from '../../../../shared/src/types/contribution';
import { LanguageCode } from '../../../../shared/src/types/language';
import { User, USER_FIRESTORE_PATH } from '../../../../shared/src/types/user';
import { toDateTime } from '../../../../shared/src/utils/date';
import { onSchedule } from 'firebase-functions/v2/scheduler';
import { DateTime } from 'luxon';
import { FirstPayoutEmailTemplateData, SendgridMailClient } from '../../../../shared/src/sendgrid/SendgridMailClient';
Expand Down Expand Up @@ -62,7 +62,7 @@ export const getFirstPayoutEmailReceivers = async (
};

// Run on the 16th of every month at 00:00
export default onSchedule('0 0 16 * *', async () => {
export default onSchedule('0 18 16 * *', async () => { // TODO: change back to '0 0 16 * *
const sendgridClient = new SendgridMailClient(process.env.SENDGRID_API_KEY!);
const firestoreAdmin = new FirestoreAdmin();

Expand Down
2 changes: 2 additions & 0 deletions functions/src/cron/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import importExchangeRatesFunction from './exchange-rate-import';
import importPostfinancePaymentsFilesFunction from './postfinance-payments-files-import';
import sendFirstPayoutEmailFunction from './first-payout-email';

export const importPostfinancePaymentsFiles = importPostfinancePaymentsFilesFunction;
export const importExchangeRates = importExchangeRatesFunction;
export const sendFirstPayoutEmail = sendFirstPayoutEmailFunction

0 comments on commit c906fbd

Please sign in to comment.