How to add image tracking pixel injection in email body so that can track opens
Hey there @quick-yak, thanks for posting. To ensure the fastest resolution to your issue, please review the following and follow all the steps:
We do not provide Click or Open tracking at this time. You could inject a tracking URL that you are handling, but normally that would be done during message assembly. Doing it in Lua would involve parsing the full message, which could significantly impact performance.
is there any function where we could update the message body ?
outside of header modification, we don’t currently expose message body modification to lua
so can you let me know how we can achieve this @free-spirited-yorksh ?
if you needed to do it right now, the approach I might suggest is a very clunky:
- Use the HTTP API to build a new copy of the message. We don’t currently provide convenience wrappers for this (Add a method of injecting a new message from lua · Issue #102 · KumoCorp/kumomta · GitHub is tracking that), so you would need to use Request - KumoMTA Docs to call it yourself. You can use
msg:get_data()to get the body of your original message, then encode whatever logic to inject your modification to that text, then pass that to the http API https://docs.kumomta.com/reference/http/api_inject_v1/ - Assign the original message to the
nullqueue so that it is discarded and so that you don’t have a duplicate message in your queues.
If you want a nicer solution, then we do accept sponsorship to influence our roadmap and priorities!
let me know how it works @free-spirited-yorksh
How what works?
sponsorship to influence the roadmap @yearning-hyena
Essentially you’d let me know exactly what you’d like implemented (easiest is to email mike@kumomta.com) and then we put together what we think the level of effort is on it, and in return for your kind donation of the amount determined, we move the request to the top of the roadmap. Donations over $25k also get into the credits in the docs, but I doubt this involves that much cost.
sure will share the deatils in the email.