Allow Gmail node to send messages formatted as HTML (#1285)

* Allowing Gmail node to send messages formatted as HTML

* Improving message field description

* Fixing lint issues

* Adding missing trailing comma

*  Small improvements to GMail-Node

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Omar Ajoue
2021-01-07 11:58:28 +01:00
committed by GitHub
parent 9b6f0ee3ee
commit 143c8bd326
4 changed files with 98 additions and 5 deletions

View File

@@ -52,6 +52,7 @@ export interface IEmail {
reference?: string;
subject: string;
body: string;
htmlBody?: string;
attachments?: IDataObject[];
}
@@ -325,6 +326,10 @@ export class Gmail implements INodeType {
attachments: attachmentsList,
};
if (this.getNodeParameter('includeHtml', i, false) as boolean === true) {
email.htmlBody = this.getNodeParameter('htmlMessage', i) as string;
}
endpoint = '/gmail/v1/users/me/messages/send';
method = 'POST';
@@ -420,6 +425,10 @@ export class Gmail implements INodeType {
attachments: attachmentsList,
};
if (this.getNodeParameter('includeHtml', i, false) as boolean === true) {
email.htmlBody = this.getNodeParameter('htmlMessage', i) as string;
}
endpoint = '/gmail/v1/users/me/messages/send';
method = 'POST';
@@ -620,6 +629,10 @@ export class Gmail implements INodeType {
attachments: attachmentsList,
};
if (this.getNodeParameter('includeHtml', i, false) as boolean === true) {
email.htmlBody = this.getNodeParameter('htmlMessage', i) as string;
}
endpoint = '/gmail/v1/users/me/drafts';
method = 'POST';