How can I get the URL in a Gmail chat from a sent message?

I integrate Gmail with the task manager using the Chrome plugin. I would like to receive a link to a Gmail conversation when a user has just added a message and linked the corresponding task. Each Gmail conversation has an associated URL, and it is located in the address bar when the user reads the conversation. If the user receives an email and then responds to it, the URL is directly in the address bar.

However, if the user creates a new message (not in response to an existing stream), the only way to find out the URL for the resulting conversation is to go to Sent mail and click on the sent message.

Given all the Gmail APIs (IMAP, gadgets, the Chrome extension bent on the page), and given that the user just clicked "Submit" in a new message, is there a way to programmatically retrieve the URL from the conversation?

+4
source share
1 answer

This is probably not the best way to do this, but if you find (through a survey, etc.) when a small warning bar appears,

enter image description here

and check if this message is "sent by e-mail" (i.e. the link to the message "View" exists inside it), then there is a DOM link in the link (which is really a range) called param , which contains a unique identifier for new conversation.

You can add this to https://mail.google.com/mail/#sent/ and you will have a unique URL for this conversation.

+3
source

Source: https://habr.com/ru/post/1340024/


All Articles