Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a gmail gadget change a message label?
    primarykey
    data
    text
    <p>I often use two gmail labels <code>label1</code> and <code>label2</code>, and according to my personal mail management rules, I often change messages categories from <code>label1</code> to <code>label2</code>.<br> As I do this often, I thought I should try to automatize this process a bit by adding custom gmail command.<br> Here are the specifications of my mini-feature :</p> <p>1) When a message (according to gmail api, a <a href="https://developers.google.com/apps-script/class_gmailthread" rel="nofollow noreferrer">"thread"</a>) labelled <code>label1</code> is selected in gmail, a button "CHANGE LABEL1 TO LABEL2" should be displayed in my gmail interface<br> 2) When I click this button, selected message's <code>label1</code> should be removed, while a <code>label2</code> label would be added </p> <p>That's it for the features.<br> Technically, here is what I think is needed : </p> <p>a) A way to get and set the labels attached to a given message thread (identified by an id)<br> b) A way to display a button conditionally<br> c) A way to trigger a script when the button is clicked<br> d) A way to detect the <a href="https://developers.google.com/apps-script/class_gmailthread#getId" rel="nofollow noreferrer">id</a> of selected message thread </p> <p>Here are the technical solutions I think are available for each part : </p> <p>a) ...is possible via a <a href="https://developers.google.com/apps-script/" rel="nofollow noreferrer">Google Apps Script</a>, using <a href="https://developers.google.com/apps-script/class_gmailthread#addLabel" rel="nofollow noreferrer">GmailThread::addLabel</a> and <a href="https://developers.google.com/apps-script/class_gmailthread#removeLabel" rel="nofollow noreferrer">GmailThread::removeLabel</a><br> b) ...seems possible via a <a href="https://developers.google.com/google-apps/gmail/contextual_gadgets#what_is_a_gmail_contextual_gadget" rel="nofollow noreferrer">contextual gadget</a><br> c) ...is my first concern, since clicking on the button from b) should launch the script from a) Also, the call to the a) script should pass the message thread id as a parameter.<br> d) ...is my second concern, maybe is it also possible via a <a href="https://developers.google.com/google-apps/gmail/contextual_gadgets#what_is_a_gmail_contextual_gadget" rel="nofollow noreferrer">contextual gadget</a>, since those can parse the contents of a message ? </p> <p>Does it seem possible to implement this mini-feature given the actual technology provided by google for scripting ?<br> More precisely, is it possible to make Gmail Gadgets and <a href="https://developers.google.com/apps-script/service_gmail" rel="nofollow noreferrer">Gmail Apps Scripts</a> interact ?<br> Or are there some alternatives to implement it ? </p> <p>Additional information : I tried to investigate other technologies provided by Google to customize its product, but it seems that <a href="https://stackoverflow.com/questions/9985378/is-gmail-lab-api-open">Gmail Labs API is not open to the public</a>. Also, I don't think I could use a <a href="https://developers.google.com/google-apps/gmail/sidebar_gadgets" rel="nofollow noreferrer">Gmail Sidebar Gadget</a> since they do not seem to be able to know which message is currently selected in the gmail interface.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload