diff --git a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts index bbfeb6dbbd..a70935b70a 100644 --- a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts @@ -80,6 +80,7 @@ export function addAdditionalFields( const additionalFields = this.getNodeParameter('additionalFields', index); if (operation === 'sendMessage') { + // [ria] && SEND_AND_WAIT ? const attributionText = 'This message was sent automatically with '; const link = createUtmCampaignLink('n8n-nodes-base.telegram', instanceId); @@ -260,14 +261,17 @@ export function createSendAndWaitMessageBody(context: IExecuteFunctions) { const config = getSendAndWaitConfig(context); let text = config.message; - const instanceId = context.getInstanceId(); - const attributionText = 'This message was sent automatically with '; - const link = createUtmCampaignLink('n8n-nodes-base.telegram', instanceId); - text = `${text}\n\n_${attributionText}_[n8n](${link})`; + if (config.appendAttribution) { + const instanceId = context.getInstanceId(); + const attributionText = 'This message was sent automatically with '; + const link = createUtmCampaignLink('n8n-nodes-base.telegram', instanceId); + text = `${text}\n\n_${attributionText}_[n8n](${link})`; + } const body = { chat_id, text, + disable_web_page_preview: true, parse_mode: 'Markdown', reply_markup: { diff --git a/packages/nodes-base/utils/sendAndWait/utils.ts b/packages/nodes-base/utils/sendAndWait/utils.ts index 6fe569825f..387f2e9c8b 100644 --- a/packages/nodes-base/utils/sendAndWait/utils.ts +++ b/packages/nodes-base/utils/sendAndWait/utils.ts @@ -29,6 +29,7 @@ export type SendAndWaitConfig = { message: string; url: string; options: Array<{ label: string; value: string; style: string }>; + appendAttribution?: boolean; }; type FormResponseTypeOptions = { @@ -231,7 +232,17 @@ export function getSendAndWaitProperties( type: 'collection', placeholder: 'Add option', default: {}, - options: [limitWaitTimeOption], + options: [ + limitWaitTimeOption, + { + displayName: 'Append n8n Attribution', + name: 'appendAttribution', + type: 'boolean', + default: true, + description: + 'Whether to include the phrase "This message was sent automatically with n8n" to the end of the message', + }, + ], displayOptions: { show: { responseType: ['approval'], @@ -272,6 +283,14 @@ export function getSendAndWaitProperties( default: 'Submit', }, limitWaitTimeOption, + { + displayName: 'Append n8n Attribution', + name: 'appendAttribution', + type: 'boolean', + default: true, + description: + 'Whether to include the phrase "This message was sent automatically with n8n" to the end of the message', + }, ], displayOptions: { show: { @@ -448,11 +467,18 @@ export function getSendAndWaitConfig(context: IExecuteFunctions): SendAndWaitCon buttonDisapprovalStyle?: string; }; + const appendAttribution = context.getNodeParameter( + 'options.appendAttribution', + 0, + true, + ) as boolean; + const config: SendAndWaitConfig = { title: subject, message, url: `${resumeUrl}/${nodeId}`, options: [], + appendAttribution, }; const responseType = context.getNodeParameter('responseType', 0, 'approval') as string;