Skip to content

Commit e2c69e8

Browse files
Modifying message content for approval workflow actions (#15649)
1 parent fe19b54 commit e2c69e8

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

components/gmail/actions/approve-workflow/approve-workflow.mjs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "gmail-approve-workflow",
55
name: "Approve Workflow",
66
description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
gmail,
@@ -20,14 +20,33 @@ export default {
2020
"subject",
2121
],
2222
},
23+
body: {
24+
propDefinition: [
25+
gmail,
26+
"body",
27+
],
28+
description: "Include an email body to send. Supports HTML",
29+
optional: true,
30+
},
31+
bodyType: {
32+
propDefinition: [
33+
gmail,
34+
"bodyType",
35+
],
36+
hidden: true,
37+
default: "html",
38+
},
2339
},
2440
async run({ $ }) {
2541
const {
2642
resume_url, cancel_url,
2743
} = $.flow.suspend();
44+
const approvalText = `Click here to approve:<br />${resume_url}<br /><br />Cancel here:<br />${cancel_url}`;
2845
const opts = await this.gmail.getOptionsToSendEmail($, {
29-
body: `Click here to approve the workflow: ${resume_url}, \nand cancel here: ${cancel_url}`,
3046
...this,
47+
body: this.body
48+
? `${this.body}<br /><br />${approvalText}`
49+
: `${approvalText}`,
3150
});
3251
const response = await this.gmail.sendEmail(opts);
3352
$.export("$summary", `Successfully sent email to ${this.to}`);

components/slack/actions/approve-workflow/approve-workflow.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import constants from "../../common/constants.mjs";
44
export default {
55
key: "slack-approve-workflow",
66
name: "Approve Workflow",
7-
description: "Suspend the workflow until approved by a slack message. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
8-
version: "0.0.1",
7+
description: "Suspend the workflow until approved by a Slack message. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
slack,
@@ -36,7 +36,7 @@ export default {
3636
message: {
3737
type: "string",
3838
label: "Message",
39-
description: "A text message to include with the Approve and Cancel Buttons",
39+
description: "Text to include with the Approve and Cancel Buttons",
4040
},
4141
},
4242
async run({ $ }) {
@@ -63,6 +63,7 @@ export default {
6363
type: "plain_text",
6464
text: "Approve",
6565
},
66+
style: "primary",
6667
url: resume_url,
6768
},
6869
{
@@ -71,6 +72,7 @@ export default {
7172
type: "plain_text",
7273
text: "Cancel",
7374
},
75+
style: "danger",
7476
url: cancel_url,
7577
},
7678
],

components/slack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/slack",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"description": "Pipedream Slack Components",
55
"main": "slack.app.mjs",
66
"keywords": [

pnpm-lock.yaml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)