mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Add appendN8nAttribution option to sendAndWait operation (#13697)
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -162,16 +162,19 @@ export function getPagingParameters(resource: string, operation = 'getAll') {
|
||||
export function createSendAndWaitMessageBody(context: IExecuteFunctions) {
|
||||
const config = getSendAndWaitConfig(context);
|
||||
|
||||
const instanceId = context.getInstanceId();
|
||||
const attributionText = '_This_ _message_ _was_ _sent_ _automatically_ _with_';
|
||||
const link = createUtmCampaignLink('n8n-nodes-base.googleChat', instanceId);
|
||||
const attribution = `${attributionText} _<${link}|n8n>_`;
|
||||
|
||||
const buttons: string[] = config.options.map(
|
||||
(option) => `*<${`${config.url}?approved=${option.value}`}|${option.label}>*`,
|
||||
);
|
||||
|
||||
const text = `${config.message}\n\n\n${buttons.join(' ')}\n\n${attribution}`;
|
||||
let text = `${config.message}\n\n\n${buttons.join(' ')}`;
|
||||
|
||||
if (config.appendAttribution !== false) {
|
||||
const instanceId = context.getInstanceId();
|
||||
const attributionText = '_This_ _message_ _was_ _sent_ _automatically_ _with_';
|
||||
const link = createUtmCampaignLink('n8n-nodes-base.googleChat', instanceId);
|
||||
const attribution = `${attributionText} _<${link}|n8n>_`;
|
||||
text += `\n\n${attribution}`;
|
||||
}
|
||||
|
||||
const body = {
|
||||
text,
|
||||
|
||||
Reference in New Issue
Block a user