Skip to content

Commit

Permalink
fix(notifications): twilio client creation (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanogdev committed Sep 27, 2020
1 parent f2f8d81 commit 5414b24
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/notification/twilio.ts
Expand Up @@ -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,
Expand Down

0 comments on commit 5414b24

Please sign in to comment.