Update index.ts
This commit is contained in:
parent
0b9ad04c19
commit
ba0f28d1db
@ -10,8 +10,8 @@ const Mailgun = require('mailgun.js');
|
||||
const { convert } = require('html-to-text');
|
||||
const twilio = require('twilio')
|
||||
|
||||
export const sendEmail = onRequest({
|
||||
region: process.env.SERVICES_RGN
|
||||
export const sendEmailMessage = onRequest({
|
||||
region: '#{SERVICES_RGN}#'
|
||||
}, (request: Request, response: express.Response) => {
|
||||
const mailgun = new Mailgun(formData);
|
||||
const mailGunClient = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY });
|
||||
@ -39,8 +39,8 @@ export const sendEmail = onRequest({
|
||||
});
|
||||
});
|
||||
|
||||
export const sendSMS = onRequest({
|
||||
region: process.env.SERVICES_RGN
|
||||
export const sendSMSMessage = onRequest({
|
||||
region: '#{SERVICES_RGN}#'
|
||||
}, (request: Request, response: express.Response) => {
|
||||
const client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
|
||||
const { to, body } = request.body;
|
||||
@ -67,9 +67,9 @@ interface Invitation {
|
||||
invitedByName: string;
|
||||
}
|
||||
|
||||
export const sendInvitationNotification = onDocumentCreated({
|
||||
export const notifyInvitation = onDocumentCreated({
|
||||
document: 'notifications/{notificationId}',
|
||||
region: process.env.SERVICES_RGN
|
||||
region: '#{SERVICES_RGN}#'
|
||||
}, async (event: any) => {
|
||||
const invitation = event.data?.data() as Invitation;
|
||||
const invitationId = event.params.invitationId;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user