From 03755d5eb117ac14797e0180c74f50b401e50cb5 Mon Sep 17 00:00:00 2001 From: ththiem Date: Sat, 26 Sep 2020 05:28:46 -0700 Subject: [PATCH] fix(notification): sms subject output (#298) --- src/logger.ts | 9 +++++++-- src/notification/sms.ts | 2 +- src/store/model/bestbuy.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/logger.ts b/src/logger.ts index 7a097f7..6584387 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -54,12 +54,17 @@ export const Print = { return `✖ ${buildProductString(link, store)} :: CAPTCHA`; }, - inStock(link: Link, store: Store, color?: boolean): string { + inStock(link: Link, store: Store, color?: boolean, sms?: boolean): string { if (color) { return chalk.bgGreen.white.bold(`🚀🚨 ${buildProductString(link, store, false)} :: IN STOCK 🚨🚀`); } - return `🚀🚨 ${buildProductString(link, store)} :: IN STOCK 🚨🚀`; + const productString = `${buildProductString(link, store)} :: IN STOCK`; + if (sms) { + return productString; + } + + return `🚀🚨 ${productString} 🚨🚀`; }, inStockWaiting(link: Link, store: Store, color?: boolean): string { if (color) { diff --git a/src/notification/sms.ts b/src/notification/sms.ts index 7b89ae5..9fc3100 100644 --- a/src/notification/sms.ts +++ b/src/notification/sms.ts @@ -27,7 +27,7 @@ export function sendSMS(link: Link, store: Store) { } ] : undefined, from: email.username, - subject: Print.inStock(link, store), + subject: Print.inStock(link, store, false, true), text: link.cartUrl ? link.cartUrl : link.url, to: generateAddress() }; diff --git a/src/store/model/bestbuy.ts b/src/store/model/bestbuy.ts index 36e407e..b2745a3 100644 --- a/src/store/model/bestbuy.ts +++ b/src/store/model/bestbuy.ts @@ -12,7 +12,7 @@ export const BestBuy: Store = { brand: 'test:brand', model: 'test:model', series: 'test:series', - url: 'https://www.bestbuy.com/site/nvidia-geforce-rtx-2060-super-8gb-gddr6-pci-express-graphics-card-black-silver/6361329.p?skuId=6361329&intl=nosplash' + url: 'https://www.bestbuy.com/site/evga-ko-ultra-gaming-nvidia-geforce-rtx-2060-6gb-gddr6-pci-express-3-0-graphics-card-black-gray/6403801.p?skuId=6403801&intl=nosplash' }, { brand: 'nvidia',