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