Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Add Subscriber",
description: "Add subscribers to the specified account and list. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/post).",
type: "action",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
165 changes: 165 additions & 0 deletions components/aweber/actions/create-broadcast/create-broadcast.mjs
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",
},
});

$.export("$summary", `Successfully created broadcast with **UUID: ${response.uuid}**.`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Create Or Update Subscriber",
description: "Create subscriber if the subscriber email is not existing or update the information for the specified subscriber by email. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/patch).",
type: "action",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/aweber/actions/get-accounts/get-accounts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "Get Accounts",
description: "Get a paginated collection of accounts. [See the docs here](https://api.aweber.com/#tag/Accounts/paths/~1accounts/get).",
type: "action",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/aweber/actions/get-lists/get-lists.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "Get Lists",
description: "Get a paginated collection of subscriber lists. [See the docs here](https://api.aweber.com/#tag/Lists/paths/~1accounts~1{accountId}~1lists/get).",
type: "action",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "Get Subscribers",
description: "Get a paginated collection of subscribers under the specified account and list. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/get).",
type: "action",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Update Subscriber",
description: "Update the information for the specified subscriber by email. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/patch).",
type: "action",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Loading
Loading