Is it possible to add a menu item to an email message using Apps Scripts? I'd like to add an item like to this menu:

I used the cat email quickstart and tried modifying it to draw that menu item on an email message but I have not been able to get it to work yet.
Here is the quickstart I'm talking about:
https://developers.google.com/apps-script/add-ons/cats-quickstartThe quickstart does show how to add a menu item to the compose email screen, but I can't see how to get this to work for an inbox email.
when composing an email the menu item is added using appsscript.json like this:
"composeTrigger": {
"selectActions": [{
"text": "Insert cat",
"runFunction": "onGmailCompose"
}],
"draftAccess": "NONE"
}
Is there some trigger that I can use for when an email is opened? I have not found one. I also tried creating the button inside the onGmailMessage function that is triggered by:
"gmail": {
"contextualTriggers": [{
"unconditional": {
},
"onTriggerFunction": "onGmailMessage"
}],
here is my onGmailMessage function:
function
onGmailMessage (e) {
// Activate temporary Gmail scopes, in this case to allow
// message metadata to be read.
var accessToken = e.gmail.accessToken;
GmailApp.setCurrentMessageAccessToken(accessToken);
var messageId = e.gmail.messageId;
var message = GmailApp.getMessageById(messageId);
var subject = message.getSubject();
var sender = message.getFrom();
// Create a card with a single card section and two widgets.
// Be sure to execute build() to finalize the card construction.
var exampleCard = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader()
.setTitle('Example card'))
.addSection(CardService.newCardSection()
.addWidget(CardService.newKeyValue()
.setTopLabel('Subject')
.setContent(subject))
.addWidget(CardService.newKeyValue()
.setTopLabel('From')
.setContent(sender)))
.build(); // Don't forget to build the Card!
return [exampleCard];
} I don't see anything when I open an email. Where is that card supposed to be displayed?