Skip to content

Commit 0151fa0

Browse files
authored
[ACTION] Front - Create Message #18076 (#18180)
* Added actions * Added actions * Added actions
1 parent 73c9cb0 commit 0151fa0

File tree

31 files changed

+109
-29
lines changed

31 files changed

+109
-29
lines changed

components/frontapp/actions/add-comment/add-comment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "frontapp-add-comment",
66
name: "Add Comment",
77
description: "Add a comment to a conversation. [See the documentation](https://dev.frontapp.com/reference/add-comment)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
frontApp,

components/frontapp/actions/archive-conversation/archive-conversation.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "frontapp-archive-conversation",
55
name: "Archive Conversation",
66
description: "Archives a conversation. [See the documentation](https://dev.frontapp.com/reference/patch_conversations-conversation-id)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
type: "action",
99
props: {
1010
frontApp,

components/frontapp/actions/assign-conversation/assign-conversation.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "frontapp-assign-conversation",
55
name: "Assign Conversation",
66
description: "Assign or unassign a conversation. [See the documentation](https://dev.frontapp.com/reference/update-conversation-assignee)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
type: "action",
99
props: {
1010
frontApp,

components/frontapp/actions/create-draft-reply/create-draft-reply.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "frontapp-create-draft-reply",
66
name: "Create Draft Reply",
77
description: "Create a new draft as a reply to the last message in the conversation. [See the documentation](https://dev.frontapp.com/reference/create-draft-reply)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
frontApp,

components/frontapp/actions/create-draft/create-draft.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "frontapp-create-draft",
66
name: "Create Draft",
77
description: "Create a draft message which is the first message of a new conversation. [See the documentation](https://dev.frontapp.com/reference/create-draft)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
frontApp,

components/frontapp/actions/create-inbox/create-inbox.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "frontapp-create-inbox",
55
name: "Create Inbox",
66
description: "Create an inbox in the default team (workspace). [See the documentation](https://dev.frontapp.com/reference/create-inbox).",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
frontApp,

components/frontapp/actions/create-message-template/create-message-template.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "frontapp-create-message-template",
77
name: "Create Message Template",
88
description: "Create a new message template. [See the documentation](https://dev.frontapp.com/reference/create-message-template).",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "action",
1111
props: {
1212
frontApp,
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import frontApp from "../../frontapp.app.mjs";
2+
3+
export default {
4+
key: "frontapp-create-message",
5+
name: "Create Message",
6+
description: "Send a new message from a channel. [See the documentation](https://dev.frontapp.com/reference/create-message).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
frontApp,
11+
channelId: {
12+
propDefinition: [
13+
frontApp,
14+
"channelId",
15+
],
16+
},
17+
to: {
18+
propDefinition: [
19+
frontApp,
20+
"to",
21+
],
22+
},
23+
cc: {
24+
propDefinition: [
25+
frontApp,
26+
"cc",
27+
],
28+
},
29+
senderName: {
30+
type: "string",
31+
label: "Sender Name",
32+
description: "Name used for the sender info of the message",
33+
optional: true,
34+
},
35+
subject: {
36+
type: "string",
37+
label: "Subject",
38+
description: "Subject of the message for email message",
39+
optional: true,
40+
},
41+
body: {
42+
type: "string",
43+
label: "Body",
44+
description: "Body of the message",
45+
},
46+
},
47+
async run({ $ }) {
48+
// const {
49+
// frontApp,
50+
// name,
51+
// teammateIds,
52+
// } = this;
53+
54+
const data = {
55+
to: this.to,
56+
cc: this.cc,
57+
sender_name: this.senderName,
58+
subject: this.subject,
59+
body: this.body,
60+
};
61+
62+
const response = await this.frontApp.createMessage({
63+
channelId: this.channelId,
64+
data,
65+
$,
66+
});
67+
68+
$.export("$summary", `Successfully created message to the recipient: "${this.to}"`);
69+
return response;
70+
},
71+
};

components/frontapp/actions/delete-message-template/delete-message-template.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "frontapp-delete-message-template",
55
name: "Delete Message Template",
66
description: "Delete a message template. [See the documentation](https://dev.frontapp.com/reference/delete-message-template).",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
frontApp,

components/frontapp/actions/get-comment/get-comment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "frontapp-get-comment",
55
name: "Get Comment",
66
description: "Retrieve a comment from a conversation. [See the documentation](https://dev.frontapp.com/reference/get-comment)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
type: "action",
99
props: {
1010
frontApp,

0 commit comments

Comments
 (0)