-
Couldn't load subscription status.
- Fork 5.5k
New Components - messagebird #15247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New Components - messagebird #15247
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b089d9a
new components
michelle0927 80c5b73
pnpm-lock.yaml
michelle0927 9765ed1
updates
michelle0927 aac32d3
update async options
michelle0927 4875d01
new components
michelle0927 8424040
pnpm-lock.yaml
michelle0927 800df0a
update
michelle0927 9a38ffd
Merge remote-tracking branch 'origin/master' into issue-15227
michelle0927 043f81c
pnpm-lock.yaml
michelle0927 9b44fb4
use $auth organization_id
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
components/messagebird/actions/create-contact/create-contact.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import messagebird from "../../messagebird.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "messagebird-create-contact", | ||
| name: "Create Contact", | ||
| description: "Creates a new contact. [See the documentation](https://docs.bird.com/api/contacts-api/api-reference/manage-workspace-contacts/create-a-contact)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| messagebird, | ||
| organizationId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "organizationId", | ||
| ], | ||
| }, | ||
| workspaceId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "workspaceId", | ||
| (c) => ({ | ||
| organizationId: c.organizationId, | ||
| }), | ||
| ], | ||
| }, | ||
| displayName: { | ||
| type: "string", | ||
| label: "Display Name", | ||
| description: "The display name for the contact", | ||
| }, | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "The email address of the contact", | ||
| optional: true, | ||
| }, | ||
| listIds: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "listIds", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.messagebird.createContact({ | ||
| $, | ||
| workspaceId: this.workspaceId, | ||
| data: { | ||
| displayName: this.displayName, | ||
| identifiers: this.email && [ | ||
| { | ||
| key: "emailaddress", | ||
| value: this.email, | ||
| }, | ||
| ], | ||
| listIds: this.listIds, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created contact with ID: ${response.id}`); | ||
| return response; | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import messagebird from "../../messagebird.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "messagebird-send-sms", | ||
| name: "Send SMS", | ||
| description: "Sends an SMS message. [See the documentation](https://docs.bird.com/api/channels-api/supported-channels/programmable-sms/sending-sms-messages)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| messagebird, | ||
| organizationId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "organizationId", | ||
| ], | ||
| }, | ||
| workspaceId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "workspaceId", | ||
| (c) => ({ | ||
| organizationId: c.organizationId, | ||
| }), | ||
| ], | ||
| }, | ||
| channelId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "channelId", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| }, | ||
| contactId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "contactId", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| }, | ||
| message: { | ||
| type: "string", | ||
| label: "Message", | ||
| description: "The message text to send", | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.messagebird.sendSmsMessage({ | ||
| $, | ||
| workspaceId: this.workspaceId, | ||
| channelId: this.channelId, | ||
| data: { | ||
| receiver: { | ||
| contacts: [ | ||
| { | ||
| id: this.contactId, | ||
| }, | ||
| ], | ||
| }, | ||
| body: { | ||
| type: "text", | ||
| text: { | ||
| text: this.message, | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully sent SMS message with ID: ${response.id}`); | ||
| return response; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
69 changes: 69 additions & 0 deletions
69
components/messagebird/actions/send-voice-message/send-voice-message.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import messagebird from "../../messagebird.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "messagebird-send-voice-message", | ||
| name: "Send Voice Message", | ||
| description: "Send a voice message to any phone number globally. [See the documentation](https://docs.bird.com/api/voice-api/voice-calls-api/initiate-an-outbound-call)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| messagebird, | ||
| organizationId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "organizationId", | ||
| ], | ||
| }, | ||
| workspaceId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "workspaceId", | ||
| (c) => ({ | ||
| organizationId: c.organizationId, | ||
| }), | ||
| ], | ||
| }, | ||
| channelId: { | ||
| propDefinition: [ | ||
| messagebird, | ||
| "channelId", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| }, | ||
| recipientNumber: { | ||
| type: "string", | ||
| label: "Recipient Number", | ||
| description: "The phone number to send the message to. Example: `+351000000000`", | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| message: { | ||
| type: "string", | ||
| label: "Message", | ||
| description: "The message to send as a voice message", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.messagebird.sendVoiceMessage({ | ||
| $, | ||
| workspaceId: this.workspaceId, | ||
| channelId: this.channelId, | ||
| data: { | ||
| to: this.recipientNumber, | ||
| callFlow: [ | ||
| { | ||
| options: { | ||
| text: this.message, | ||
| }, | ||
| command: "say", | ||
| }, | ||
| { | ||
| command: "hangup", | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully sent voice message with ID: ${response.id}`); | ||
| return response; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.