I have setup an email node with Oauth2 authentication, that side of it is working, I have got the access token ok.
I am getting an error on deploy when from the email node itself. ("ReferenceError: msg is not defined") This is only when I enable the Oauth2 authentication in the email node. so perhaps there is an issue in my message it is not properly defined for the email node? Ive tried a couple/alot of different format options havent managed as yet. What am I missing?
// Extract necessary values from input msg
let access_token = msg.oauth2Response.access_token;
// Create a new message object with only the necessary properties
let newMsg = {
payload: 'this is a dummy email',
topic: 'some title',
oauth2Response: {
access_token: access_token
}
};
// Return the new message object
return newMsg;
also tried this function to create the email.
// Add payload and topic properties to the msg object
msg.payload = 'this is a dummy email';
msg.topic = 'some title';
// Return the modified msg object
return msg;