From 2f4fe2f42d4a77bc8bfbb20046461648cbfda3d7 Mon Sep 17 00:00:00 2001 From: Benoy Bose Date: Sat, 15 Mar 2025 12:46:39 +0530 Subject: [PATCH] Updated to FUNCTION_REGION --- functions/.env.example | 2 +- functions/src/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/.env.example b/functions/.env.example index 5efdc05..17fa751 100644 --- a/functions/.env.example +++ b/functions/.env.example @@ -4,4 +4,4 @@ MAILGUN_FROM_ADDRESS=#{MAILGUN_FROM_ADDRESS}# TWILIO_ACCOUNT_SID=#{TWILIO_ACCOUNT_SID}# TWILIO_AUTH_TOKEN=#{TWILIO_AUTH_TOKEN}# TWILIO_PHONE_NUMBER=#{TWILIO_PHONE_NUMBER}# -FIREBASE_FUNCTION_REGION=#{FIREBASE_FUNCTION_REGION}# +FUNCTION_REGION=#{FUNCTION_REGION}# diff --git a/functions/src/index.ts b/functions/src/index.ts index b0ba8e8..c53e723 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -11,7 +11,7 @@ const { convert } = require('html-to-text'); const twilio = require('twilio') export const sendEmail = onRequest({ - region: process.env.FIREBASE_FUNCTION_REGION + region: process.env.FUNCTION_REGION }, (request: Request, response: express.Response) => { const mailgun = new Mailgun(formData); const mailGunClient = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY }); @@ -40,7 +40,7 @@ export const sendEmail = onRequest({ }); export const sendSMS = onRequest({ - region: process.env.FIREBASE_FUNCTION_REGION + region: process.env.FUNCTION_REGION }, (request: Request, response: express.Response) => { const client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN); const { to, body } = request.body; @@ -69,7 +69,7 @@ interface Invitation { export const sendInvitationNotification = onDocumentCreated({ document: 'notifications/{notificationId}', - region: process.env.FIREBASE_FUNCTION_REGION + region: process.env.FUNCTION_REGION }, async (event: any) => { const invitation = event.data?.data() as Invitation; const invitationId = event.params.invitationId;