fix(notifications): twilio client creation (#349)

This commit is contained in:
Seán O'Grady
2020-09-27 22:23:48 +01:00
committed by GitHub
parent f2f8d81498
commit 5414b249a6
+1 -2
View File
@@ -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,