feat(notification): add product link to email and telegram (#816)

This commit is contained in:
VictorV
2020-11-18 07:23:31 -08:00
committed by GitHub
parent 229daabb34
commit 777c31b420
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ export function sendEmail(link: Link, store: Store) {
: undefined,
from: email.username,
subject: Print.inStock(link, store),
text: link.cartUrl ? link.cartUrl : link.url,
text: Print.productInStock(link),
to: email.to
};
+2 -2
View File
@@ -14,7 +14,7 @@ export function sendTelegramMessage(link: Link, store: Store) {
logger.debug('↗ sending telegram message');
(async () => {
const givenUrl = link.cartUrl ? link.cartUrl : link.url;
const message = Print.productInStock(link);
const results = [];
for (const chatId of telegram.chatId) {
@@ -22,7 +22,7 @@ export function sendTelegramMessage(link: Link, store: Store) {
results.push(
client.sendMessage(
chatId,
`${Print.inStock(link, store)}\n${givenUrl}`
`${Print.inStock(link, store)}\n${message}`
)
);
logger.info('✔ telegram message sent');