mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 08:47:43 +00:00
feat(notification): add product link to email and telegram (#816)
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user