Format Telegram visitor notifications
This commit is contained in:
@@ -1250,13 +1250,12 @@ function telegramWebhookUrl(settings) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function telegramVisitorMessageText(conversation, message, attachmentCount) {
|
function telegramVisitorMessageText(conversation, message, attachmentCount) {
|
||||||
|
const heading = `MaalFlows: ${[conversation.countryFlag, conversation.visitorLabel || "Navstevnik"].filter(Boolean).join(" ")}`;
|
||||||
const lines = [
|
const lines = [
|
||||||
`MaalFlows: nova zprava`,
|
heading,
|
||||||
`${conversation.countryFlag || ""} ${conversation.visitorLabel || "Navstevnik"} · ${conversation.customerLanguage || conversation.language || "jazyk ?"}`,
|
conversation.currentUrl ? `Stranka: ${shortText(conversation.currentUrl, 180)}` : "",
|
||||||
conversation.currentUrl ? `Stranka: ${shortText(conversation.currentUrl, 160)}` : "",
|
|
||||||
conversation.referrer ? `Prislel z: ${shortText(conversation.referrer, 120)}` : "",
|
|
||||||
"",
|
"",
|
||||||
message.body || (attachmentCount ? "(poslana fotka)" : ""),
|
message.body ? `Zprava: ${message.body}` : (attachmentCount ? "Zprava: (poslana fotka)" : ""),
|
||||||
message.translated_body ? `\nPreklad: ${message.translated_body}` : "",
|
message.translated_body ? `\nPreklad: ${message.translated_body}` : "",
|
||||||
attachmentCount ? `\nPrilohy: ${attachmentCount} fotka/fotek` : "",
|
attachmentCount ? `\nPrilohy: ${attachmentCount} fotka/fotek` : "",
|
||||||
"",
|
"",
|
||||||
|
|||||||
Reference in New Issue
Block a user