diff --git a/packages/nodes-base/nodes/Gotify/Gotify.node.ts b/packages/nodes-base/nodes/Gotify/Gotify.node.ts index e2699f9275..a535378461 100644 --- a/packages/nodes-base/nodes/Gotify/Gotify.node.ts +++ b/packages/nodes-base/nodes/Gotify/Gotify.node.ts @@ -84,7 +84,7 @@ export class Gotify implements INodeType { }, }, default: '', - description: 'The message. Markdown (excluding html) is allowed.', + description: 'The message to send, If using Markdown add the Content Type option', }, { displayName: 'Additional Fields', @@ -115,6 +115,38 @@ export class Gotify implements INodeType { }, ], }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + displayOptions: { + show: { + resource: ['message'], + operation: ['create'], + }, + }, + default: {}, + options: [ + { + displayName: 'Content Type', + name: 'contentType', + type: 'options', + default: 'text/plain', + description: 'The message content type', + options: [ + { + name: 'Plain', + value: 'text/plain', + }, + { + name: 'Markdown', + value: 'text/markdown', + }, + ], + }, + ], + }, { displayName: 'Message ID', name: 'messageId', @@ -176,11 +208,20 @@ export class Gotify implements INodeType { const message = this.getNodeParameter('message', i) as string; const additionalFields = this.getNodeParameter('additionalFields', i); + const options = this.getNodeParameter('options', i); const body: IDataObject = { message, }; + if (options.contentType) { + body.extras = { + 'client::display': { + contentType: options.contentType, + }, + }; + } + Object.assign(body, additionalFields); responseData = await gotifyApiRequest.call(this, 'POST', '/message', body);