@pipedream/microsoft_outlook 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "microsoft_outlook-approve-workflow",
|
|
5
|
+
name: "Approve Workflow",
|
|
6
|
+
description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
microsoftOutlook,
|
|
11
|
+
recipients: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
microsoftOutlook,
|
|
14
|
+
"recipients",
|
|
15
|
+
],
|
|
16
|
+
optional: false,
|
|
17
|
+
},
|
|
18
|
+
subject: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
microsoftOutlook,
|
|
21
|
+
"subject",
|
|
22
|
+
],
|
|
23
|
+
optional: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
async run({ $ }) {
|
|
27
|
+
const {
|
|
28
|
+
resume_url, cancel_url,
|
|
29
|
+
} = $.flow.suspend();
|
|
30
|
+
const opts = {
|
|
31
|
+
content: `Click here to approve the workflow: ${resume_url}, \nand cancel here: ${cancel_url}`,
|
|
32
|
+
ccRecipients: [],
|
|
33
|
+
bccRecipients: [],
|
|
34
|
+
...this,
|
|
35
|
+
};
|
|
36
|
+
const response = await this.microsoftOutlook.sendEmail({
|
|
37
|
+
$,
|
|
38
|
+
data: {
|
|
39
|
+
message: {
|
|
40
|
+
...this.microsoftOutlook.prepareMessageBody(opts),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
$.export("$summary", "Email has been sent.");
|
|
45
|
+
return response;
|
|
46
|
+
},
|
|
47
|
+
};
|