-
Couldn't load subscription status.
- Fork 5.5k
14336 aweber #18738
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
14336 aweber #18738
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5af1965
Enhance Aweber component with new actions and updates
luancazarine 76006bd
pnpm update
luancazarine 44b6eb2
Fix typos in Aweber component descriptions and property names
luancazarine 68a4918
Update readOnlyHint in create-broadcast action to allow editing
luancazarine 5671e0d
Update create-broadcast action to make body HTML and body text optional
luancazarine 8ecba49
Update components/aweber/actions/create-broadcast/create-broadcast.mjs
luancazarine e088d8f
Update components/aweber/sources/new-broadcast-event/new-broadcast-ev…
luancazarine 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
165 changes: 165 additions & 0 deletions
165
components/aweber/actions/create-broadcast/create-broadcast.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,165 @@ | ||
| import aweberApp from "../../aweber.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "aweber-create-broadcast", | ||
| name: "Create Broadcast", | ||
| description: "Create a broadcast under the specified account and list. [See the documentation](https://api.aweber.com/#tag/Broadcasts/paths/~1accounts~1%7BaccountId%7D~1lists~1%7BlistId%7D~1broadcasts/post).", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| aweberApp, | ||
| accountId: { | ||
| propDefinition: [ | ||
| aweberApp, | ||
| "accountId", | ||
| ], | ||
| }, | ||
| listId: { | ||
| propDefinition: [ | ||
| aweberApp, | ||
| "listId", | ||
| ({ accountId }) => ({ | ||
| accountId, | ||
| }), | ||
| ], | ||
| }, | ||
| bodyHTML: { | ||
| type: "string", | ||
| label: "Body HTML", | ||
| description: "The content of the message in HTML format. If `Body Text` is not provided, it will be auto-generated. If `Body Text` is not provided, `Body HTML` must be provided.", | ||
| optional: true, | ||
| }, | ||
| bodyText: { | ||
| type: "string", | ||
| label: "Body Text", | ||
| description: "The content of the message in plain text, used when HTML is not supported. If `Body HTML` is not provided, the broadcast will be sent using only the `Body Text`. If `Body Text` is not provided, `Body HTML` must be provided.", | ||
| optional: true, | ||
| }, | ||
| bodyAmp: { | ||
| type: "string", | ||
| label: "Body AMP", | ||
| description: "The content of the message in AMP format. [Read Aweber KB article before using this field](https://help.aweber.com/hc/en-us/articles/360025741194)", | ||
| optional: true, | ||
| }, | ||
| clickTrackingEnabled: { | ||
| type: "boolean", | ||
| label: "Click Tracking Enabled", | ||
| description: "Enables links in the email message to be tracked.", | ||
| optional: true, | ||
| }, | ||
| excludeLists: { | ||
| propDefinition: [ | ||
| aweberApp, | ||
| "listSelfLink", | ||
| ({ accountId }) => ({ | ||
| accountId, | ||
| }), | ||
| ], | ||
| type: "string[]", | ||
| label: "Exclude Lists", | ||
| description: "List of [Lists](https://api.aweber.com/#tag/Lists) URLs to exclude in the delivery of this broadcast. **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`**", | ||
| optional: true, | ||
| }, | ||
| includeLists: { | ||
| propDefinition: [ | ||
| aweberApp, | ||
| "listSelfLink", | ||
| ({ accountId }) => ({ | ||
| accountId, | ||
| }), | ||
| ], | ||
| type: "string[]", | ||
| label: "Include Lists", | ||
| description: "List of [Lists](https://api.aweber.com/#tag/Lists) URLs to include in the delivery of this broadcast. **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`**", | ||
| optional: true, | ||
| }, | ||
| facebookIntegration: { | ||
| propDefinition: [ | ||
| aweberApp, | ||
| "integrations", | ||
| ({ accountId }) => ({ | ||
| accountId, | ||
| serviceName: "facebook", | ||
| }), | ||
| ], | ||
| label: "Facebook Integration", | ||
| description: "URL to the [Facebook broadcast integration](https://api.aweber.com/#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be posted to this Facebook integration - **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`**.", | ||
| optional: true, | ||
| }, | ||
| isArchived: { | ||
| type: "boolean", | ||
| label: "Is Archived", | ||
| description: "Whether the broadcast enabled sharing via an archive URL.", | ||
| optional: true, | ||
| }, | ||
| notifyOnSend: { | ||
| type: "boolean", | ||
| label: "Notify on Send", | ||
| description: "If true, notify when stats are available on a sent broadcast message.", | ||
| optional: true, | ||
| }, | ||
| segmentLink: { | ||
| propDefinition: [ | ||
| aweberApp, | ||
| "segmentSelfLink", | ||
| ({ | ||
| accountId, listId, | ||
| }) => ({ | ||
| accountId, | ||
| listId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| subject: { | ||
| type: "string", | ||
| label: "Subject", | ||
| description: "The broadcast subject line. Subject must not be empty nor contain only whitespace.", | ||
| }, | ||
| twitterIntegration: { | ||
| propDefinition: [ | ||
| aweberApp, | ||
| "integrations", | ||
| ({ accountId }) => ({ | ||
| accountId, | ||
| serviceName: "twitter", | ||
| }), | ||
| ], | ||
| label: "Twitter Integration", | ||
| description: "URL to the [Twitter broadcast integration](https://api.aweber.com/#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be tweeted - **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`**.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.aweberApp.createBroadcast({ | ||
| $, | ||
| accountId: this.accountId, | ||
| listId: this.listId, | ||
| data: { | ||
| body_html: this.bodyHTML, | ||
| body_text: this.bodyText, | ||
| body_amp: this.bodyAmp, | ||
| click_tracking_enabled: this.clickTrackingEnabled, | ||
| exclude_lists: this.excludeLists, | ||
| include_lists: this.includeLists, | ||
| facebook_integration: this.facebookIntegration, | ||
| is_archived: this.isArchived, | ||
| notify_on_send: this.notifyOnSend, | ||
| segment_link: this.segmentLink, | ||
| subject: this.subject, | ||
| twitter_integration: this.twitterIntegration, | ||
| }, | ||
| headers: { | ||
| "Content-Type": "application/x-www-form-urlencoded", | ||
| }, | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created broadcast with **UUID: ${response.uuid}**.`); | ||
| 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
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
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
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
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
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.