I have replaced the "Send" button in the compose dialog with my "Send" button and using "Gmail API" to send the email.
I am able to send the email and get the response.
Now to make it more user-friendly, I want to close the compose dialog after my email is sent (similarly when the Gmail closes the dialog when email is sent). But I am unable to do so.
NOTE: When the email is sent successfully using "Gmail API", I am deleting the draft for that email also.
UPDATE:
Using JQuery, I get the "X" (Close) element in the dialog which is an image-
<img class="Ha" id=":2i" src="images/cleardot.gif" alt="Close" aria-label="Save & Close" data-tooltip-delay="800" data-tooltip="Save & Close">
I want to trigger a click event on it but it is not triggering.
When I tried triggering the click event on the "Discard" button of the same dialog, it worked successfully. Here is the discard button-
<div id=":68" class="oh J-Z-I J-J5-Ji T-I-ax7" tabindex="1" role="button" data-tooltip="Discard draft" aria-label="Discard draft" style="user-select: none;">
How do I click on the img
tag?