KamoCRM

Send an outbound attachment to the endpoint its type belongs to

FixMediaService
Shipped
13 ஆகஸ்ட், 2026 அன்று 5:22 AM UTC
Author
Kamo
Commit
d01ef68

Every social attachment went out through the adapter's sendImage, which on Telegram is /sendPhoto. A PDF or a zip posted there is rejected by the provider, and the rejection arrives long after the HTTP response has told the agent their message went out — so a receipt sent to a customer appeared in the agent's own window and never arrived at the other end. Route by what the file actually is: image, audio and video keep their own endpoints, everything else travels as a document. SVG is deliberately a document, matching how the chat renders it. When the MIME is missing or generic the extension decides, and an unknown file still sends — as a file, the one kind every provider accepts for arbitrary content. Also log when a message carries more than one attachment: only the first can be relayed, because a message holds a single MediaObjSocialRef.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing