mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
fix(notifications): twilio client creation (#349)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user