I am creating a custom component for Lightning for Gmail.
I want to read the content of email body. I created a test component and a controller for it.
<aura:component implements="clients:availableForMailAppAppPage,clients:hasItemContext">
<aura:attribute name="messageBody" type="String" />
<ui:button label="Click" press="{!c.myAction}"/>
</aura:component>
myAction : function(component, event, helper) {
console.log(component.get("v.messageBody"));
}
But in the console after clicking my button I see only "undefined".
At the same time, if for example I add to the controller console.log(component.get("v.people").from.name);
, then in the console I can see the sender's name.
Also I tried to remove from the code line <aura:attribute name="messageBody" type="String" />
, but nothing has changed.
What am I doing wrong?