mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 07:25:19 +02:00
Remove scheduled trail-reminder email when STRIPE_API_KEY is set
This commit is contained in:
parent
e1f8de527a
commit
83f50a59dc
2 changed files with 9 additions and 5 deletions
|
@ -33,6 +33,8 @@ const envSchema = z.object({
|
||||||
|
|
||||||
NX_CDN_PRIVATE_BUCKET: z.string().default('REPLACE_THIS'),
|
NX_CDN_PRIVATE_BUCKET: z.string().default('REPLACE_THIS'),
|
||||||
NX_CDN_PUBLIC_BUCKET: z.string().default('REPLACE_THIS'),
|
NX_CDN_PUBLIC_BUCKET: z.string().default('REPLACE_THIS'),
|
||||||
|
|
||||||
|
STRIPE_API_KEY: z.string().optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const env = envSchema.parse(process.env)
|
const env = envSchema.parse(process.env)
|
||||||
|
|
|
@ -154,11 +154,13 @@ syncInstitutionQueue.add(
|
||||||
*/
|
*/
|
||||||
sendEmailQueue.process('send-email', async (job) => await emailProcessor.send(job.data))
|
sendEmailQueue.process('send-email', async (job) => await emailProcessor.send(job.data))
|
||||||
|
|
||||||
sendEmailQueue.add(
|
if (env.STRIPE_API_KEY) {
|
||||||
|
sendEmailQueue.add(
|
||||||
'send-email',
|
'send-email',
|
||||||
{ type: 'trial-reminders' },
|
{ type: 'trial-reminders' },
|
||||||
{ repeat: { cron: '0 */12 * * *' } } // Run every 12 hours
|
{ repeat: { cron: '0 */12 * * *' } } // Run every 12 hours
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Fallback - usually triggered by errors not handled (or thrown) within the Bull event handlers (see above)
|
// Fallback - usually triggered by errors not handled (or thrown) within the Bull event handlers (see above)
|
||||||
process.on(
|
process.on(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue