mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Gotify Node): Add option to set content type to support Markdown messages (#8442)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user