From d3dd2cb1863f5460246d0865c3ddad7538817f15 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Mon, 17 Feb 2025 21:36:06 -0800 Subject: [PATCH 1/3] Modifying message content --- .../approve-workflow/approve-workflow.mjs | 22 +++++++++++++++++-- .../approve-workflow/approve-workflow.mjs | 8 ++++--- pnpm-lock.yaml | 6 ++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/components/gmail/actions/approve-workflow/approve-workflow.mjs b/components/gmail/actions/approve-workflow/approve-workflow.mjs index e18b9a2227ce3..13a4eed443bbe 100644 --- a/components/gmail/actions/approve-workflow/approve-workflow.mjs +++ b/components/gmail/actions/approve-workflow/approve-workflow.mjs @@ -4,7 +4,7 @@ export default { key: "gmail-approve-workflow", name: "Approve Workflow", description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { gmail, @@ -20,14 +20,32 @@ export default { "subject", ], }, + body: { + propDefinition: [ + gmail, + "body", + ], + optional: true, + }, + bodyType: { + propDefinition: [ + gmail, + "bodyType", + ], + hidden: true, + default: "plaintext", + }, }, async run({ $ }) { const { resume_url, cancel_url, } = $.flow.suspend(); + const approvalText = `Click here to approve:
${resume_url}

Cancel here:
${cancel_url}`; const opts = await this.gmail.getOptionsToSendEmail($, { - body: `Click here to approve the workflow: ${resume_url}, \nand cancel here: ${cancel_url}`, ...this, + body: this.body + ? `${this.body}

${approvalText}` + : `${approvalText}`, }); const response = await this.gmail.sendEmail(opts); $.export("$summary", `Successfully sent email to ${this.to}`); diff --git a/components/slack/actions/approve-workflow/approve-workflow.mjs b/components/slack/actions/approve-workflow/approve-workflow.mjs index ce8daab1ecd91..e61bf187c26e2 100644 --- a/components/slack/actions/approve-workflow/approve-workflow.mjs +++ b/components/slack/actions/approve-workflow/approve-workflow.mjs @@ -4,8 +4,8 @@ import constants from "../../common/constants.mjs"; export default { key: "slack-approve-workflow", name: "Approve Workflow", - description: "Suspend the workflow until approved by a slack message. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)", - version: "0.0.1", + description: "Suspend the workflow until approved by a Slack message. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)", + version: "0.0.2", type: "action", props: { slack, @@ -36,7 +36,7 @@ export default { message: { type: "string", label: "Message", - description: "A text message to include with the Approve and Cancel Buttons", + description: "Text to include with the Approve and Cancel Buttons", }, }, async run({ $ }) { @@ -63,6 +63,7 @@ export default { type: "plain_text", text: "Approve", }, + style: "primary", url: resume_url, }, { @@ -71,6 +72,7 @@ export default { type: "plain_text", text: "Cancel", }, + style: "danger", url: cancel_url, }, ], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 227bc6cf3053f..bb6beb3642cc8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -313,8 +313,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/adobe_photoshop_lightroom: - specifiers: {} + components/adobe_photoshop_lightroom: {} components/adobe_sign: {} @@ -7549,8 +7548,7 @@ importers: specifier: ^0.9.0 version: 0.9.0 - components/opnform: - specifiers: {} + components/opnform: {} components/opsgenie: dependencies: From 44af5e61343caf30958dbb5c8f02a035cf63f82c Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Mon, 17 Feb 2025 22:09:38 -0800 Subject: [PATCH 2/3] package json --- components/gmail/package.json | 2 +- components/slack/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/gmail/package.json b/components/gmail/package.json index 88d97cadb1de0..7095b9626eaf5 100644 --- a/components/gmail/package.json +++ b/components/gmail/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/gmail", - "version": "0.2.0", + "version": "0.2.1", "description": "Pipedream Gmail Components", "main": "gmail.app.mjs", "keywords": [ diff --git a/components/slack/package.json b/components/slack/package.json index 49c15480797ad..060f3e2262d73 100644 --- a/components/slack/package.json +++ b/components/slack/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/slack", - "version": "0.9.0", + "version": "0.9.1", "description": "Pipedream Slack Components", "main": "slack.app.mjs", "keywords": [ From 39bc74aaf6f54863147783a8b336b316ea6d12e4 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Tue, 18 Feb 2025 11:18:14 -0500 Subject: [PATCH 3/3] updates --- components/gmail/actions/approve-workflow/approve-workflow.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/gmail/actions/approve-workflow/approve-workflow.mjs b/components/gmail/actions/approve-workflow/approve-workflow.mjs index 13a4eed443bbe..2c0ecf1afcb08 100644 --- a/components/gmail/actions/approve-workflow/approve-workflow.mjs +++ b/components/gmail/actions/approve-workflow/approve-workflow.mjs @@ -25,6 +25,7 @@ export default { gmail, "body", ], + description: "Include an email body to send. Supports HTML", optional: true, }, bodyType: { @@ -33,7 +34,7 @@ export default { "bodyType", ], hidden: true, - default: "plaintext", + default: "html", }, }, async run({ $ }) {