Possible to inject a hidden field into the email being sent?

841 views
Skip to first unread message

Winston Pang

unread,
Apr 23, 2016, 12:33:22 AM4/23/16
to InboxSDK
So I know that you can listen to the presending field, but is it possible to inject at that stage, a hidden html element which has a tracking reference of some sort?

Thank you.

Omar Ismail

unread,
Apr 23, 2016, 2:17:38 AM4/23/16
to Winston Pang, InboxSDK
Yes, it's possible to inject HTML at that point. There's a couple of caveats though.

1. you shouldn't inject HTML into a compose that is plain text. Right now the SDK does not expose whether a compose is plain text or not, so we'll need to add that. The problem is that if you inject html into plain text then the email gets sent with all the html visible as regular text (i.e. gross)

2. you can't really make a hidden element with the limited formatting that gmail provides. But a div with a 1 pixel image that is just white space is for all intents and purposes invisible.

3. The user can send the same email multiple times (user cancels mid-send, or retries) so when you inject your html try to see if you've already injected it and handle that case appropriately.


Omar

On Fri, Apr 22, 2016 at 9:33 PM, Winston Pang <winst...@gmail.com> wrote:
So I know that you can listen to the presending field, but is it possible to inject at that stage, a hidden html element which has a tracking reference of some sort?

Thank you.

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/4f8f4d1a-f6cf-46af-b22c-f439eab54b2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Winston Pang

unread,
Apr 23, 2016, 2:27:33 AM4/23/16
to InboxSDK, winst...@gmail.com
Hmmm, you make a good point regarding the plain text issue.

Have your product ever encountered a need to track each email being sent? The purpose of the hidden field is to form an association with the email being sent/replied to an internal ID to a record in our business system.

I take it that you can't force the email to be sent as HTML then eh?

Thank you again for the continued support and fast replies.

Omar Ismail

unread,
Apr 23, 2016, 2:34:09 AM4/23/16
to Winston Pang, InboxSDK
yes (https://www.streak.com/email-tracking-in-gmail) and it's a very annoying pain in the butt.

But it sounds like your'e doing something different. Why are you injecting something in the email just to form an association between a message and your own id?

The composeView has a destroy event, and if you listen to that event the callback will be called with an event argument that may have a "messageId" that messageId will be the messageId of the sent email. So if you just want to track an email message and associate that with an identifier in your system then you don't need to do an injection.

The only reason to do an injection is if you're doing email open tracking or link tracking.


Omar

Winston Pang

unread,
Apr 23, 2016, 3:50:13 AM4/23/16
to InboxSDK, winst...@gmail.com
The purpose of our association s a feature that we have -- storing emails associated to a business entity.

We have yet to build this yet, but the intention is to have a service that runs on our server, that can monitor any replies the user receives that originated from that e-mail chain, so that we can store each of those replies against the business entity that was associated. 

One idea is to obviously have a hidden tracking link or meta information that can be scanned. Because the person who replies to the email will likely just hit reply and the reply would contain that piece of meta information. Once the email comes back, our background service could scan for this meta information and store this back into the associated entity.

That would work in most cases.

The other way was to form an association of a threadId to the business entity. And have the service actively look at all threads that have an association, and look at all the messages, and see which ones haven't been copied over yet.

The problem with this I guess would be, when you start an e-mail off, there probably won't be a threadId yet and only a messageId, like what you have said from the destroy event's callback.

Winston Pang

unread,
Apr 23, 2016, 4:11:55 AM4/23/16
to InboxSDK, winst...@gmail.com
Also looks like my threadId idea would back fire if they turned conversations off...

kir...@iriscrm.com

unread,
Jul 17, 2018, 1:05:01 PM7/17/18
to InboxSDK
Hey Omar,
How do you track email opens?
If I inject image tracker on presending, it will render image right away, so email will be tracked even before sending.
How do you avoid this?
Thanks
Kirill

Emad Ibrahim

unread,
Jan 8, 2019, 2:02:25 PM1/8/19
to InboxSDK
Did you ever figure out a solution?  I am having the same issue.  It renders the image right away.

Mahinda Ellegala

unread,
Apr 23, 2020, 12:16:01 AM4/23/20
to InboxSDK
@Omar, the id the destroy event return is not the same as the message id.
Reply all
Reply to author
Forward
0 new messages