Skip to content

Commit d3dd2cb

Browse files
Modifying message content
1 parent b4fb1d8 commit d3dd2cb

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

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

Lines changed: 20 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,32 @@ export default {
2020
"subject",
2121
],
2222
},
23+
body: {
24+
propDefinition: [
25+
gmail,
26+
"body",
27+
],
28+
optional: true,
29+
},
30+
bodyType: {
31+
propDefinition: [
32+
gmail,
33+
"bodyType",
34+
],
35+
hidden: true,
36+
default: "plaintext",
37+
},
2338
},
2439
async run({ $ }) {
2540
const {
2641
resume_url, cancel_url,
2742
} = $.flow.suspend();
43+
const approvalText = `Click here to approve:<br />${resume_url}<br /><br />Cancel here:<br />${cancel_url}`;
2844
const opts = await this.gmail.getOptionsToSendEmail($, {
29-
body: `Click here to approve the workflow: ${resume_url}, \nand cancel here: ${cancel_url}`,
3045
...this,
46+
body: this.body
47+
? `${this.body}<br /><br />${approvalText}`
48+
: `${approvalText}`,
3149
});
3250
const response = await this.gmail.sendEmail(opts);
3351
$.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
],

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)