From 5414b249a6f938615cfad02ca22c171a5f86e127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20O=27Grady?= Date: Sun, 27 Sep 2020 22:23:48 +0100 Subject: [PATCH] fix(notifications): twilio client creation (#349) --- src/notification/twilio.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/notification/twilio.ts b/src/notification/twilio.ts index 57e20b8a44..a2cf6aac50 100644 --- a/src/notification/twilio.ts +++ b/src/notification/twilio.ts @@ -5,14 +5,13 @@ import twilio from 'twilio'; const config = Config.notifications.twilio; -const client = twilio(config.accountSid, config.authToken); - export function sendTwilioMessage(link: Link, store: Store) { (async () => { const givenUrl = link.cartUrl ? link.cartUrl : link.url; const message = `${Print.inStock(link, store)}\n${givenUrl}`; try { + const client = twilio(config.accountSid, config.authToken); await client.messages.create({ body: message, from: config.from,