Closed GTP95 closed 2 years ago
Checking the source, the following might work?
const subjectNode = api.dom.email_subject();
subjectNode.text("New subject");
I think I'm not calling the right method:
const subjectNode = domEmail.email_subject();
subjectNode.text(subject);
gives TypeError: domEmail.email_subject is not a function
.
const subjectNode = api.dom.email_subject();
subjectNode.text(subject);
gives ReferenceError: api is not defined
and
const subjectNode = gmail.api.dom.email_subject();
subjectNode.text(subject);
gives TypeError: Cannot read properties of undefined (reading 'dom')
.
How should I call the right method?
Thank you for your help,
GTP
Never mind, I found that in my case I have to call it like this: const subjectNode = gmail.dom.email_subject();
. Thank you for your help.
Greetings,
I'm trying to modify the data shown when a certain kind of email is opened from inbox view. After getting a reference to the email's DOM using the dedicated observer like so
I can change the email's body with
But I'm failing to do the same for the email's subject. I tried both
domEmail.email_subject(subject)
anddomEmail.subject(subject)
but in both cases I get a TypeError saying that what I'm calling isn't a function. Is there a way to set or modify an email's subject? Thank you for your help,GTP