Skip to content

Commit e3fcf9d

Browse files
Merging pull request #16012
* Added actions * Update components/autobound/actions/write-personalized-content/write-personalized-content.mjs * Update components/autobound/common/constants.mjs * Update components/autobound/common/constants.mjs --------- Co-authored-by: michelle0927 <[email protected]>
1 parent d95b1c9 commit e3fcf9d

File tree

5 files changed

+172
-6
lines changed

5 files changed

+172
-6
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import app from "../../autobound.app.mjs";
2+
3+
export default {
4+
key: "autobound-write-personalized-content",
5+
name: "Write Personalized Content",
6+
description: "Write personalized content using Autobound. [See the documentation](https://autobound-api.readme.io/docs/generate-personalized-content-copy)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
contentType: {
12+
propDefinition: [
13+
app,
14+
"contentType",
15+
],
16+
},
17+
contactEmail: {
18+
propDefinition: [
19+
app,
20+
"contactEmail",
21+
],
22+
},
23+
userEmail: {
24+
propDefinition: [
25+
app,
26+
"userEmail",
27+
],
28+
},
29+
writingStyle: {
30+
propDefinition: [
31+
app,
32+
"writingStyle",
33+
],
34+
},
35+
additionalContext: {
36+
propDefinition: [
37+
app,
38+
"additionalContext",
39+
],
40+
},
41+
wordCount: {
42+
propDefinition: [
43+
app,
44+
"wordCount",
45+
],
46+
},
47+
},
48+
49+
async run({ $ }) {
50+
const response = await this.app.writePersonalizedContent({
51+
$,
52+
data: {
53+
contactEmail: this.contactEmail,
54+
userEmail: this.userEmail,
55+
contentType: this.contentType,
56+
writingStyle: this.writingStyle,
57+
additionalContext: this.additionalContext,
58+
wordCount: this.wordCount,
59+
},
60+
});
61+
$.export("$summary", "Successfully generated personalized content");
62+
return response;
63+
},
64+
};
Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,70 @@
1+
import { axios } from "@pipedream/platform";
2+
import constants from "./common/constants.mjs";
3+
14
export default {
25
type: "app",
36
app: "autobound",
4-
propDefinitions: {},
7+
propDefinitions: {
8+
contactEmail: {
9+
type: "string",
10+
label: "Contact Email",
11+
description: "The email address of the contact the user is reaching out to",
12+
},
13+
userEmail: {
14+
type: "string",
15+
label: "User Email",
16+
description: "The email address of the user the content is written on behalf of",
17+
},
18+
contentType: {
19+
type: "string",
20+
label: "Content Type",
21+
description: "Type of content to generate",
22+
options: constants.CONTENT_TYPES,
23+
},
24+
writingStyle: {
25+
type: "string",
26+
label: "Writing Style",
27+
description: "Writing style for content generation",
28+
options: constants.WRITING_STYLES,
29+
},
30+
additionalContext: {
31+
type: "string",
32+
label: "Additional Context",
33+
description: "Extra information for customizing generated content",
34+
},
35+
wordCount: {
36+
type: "integer",
37+
label: "Word Count",
38+
description: "Approximate word count for output",
39+
},
40+
},
541
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
42+
_baseUrl() {
43+
return "https://api.autobound.ai/api/external";
44+
},
45+
async _makeRequest(opts = {}) {
46+
const {
47+
$ = this,
48+
path,
49+
headers,
50+
...otherOpts
51+
} = opts;
52+
return axios($, {
53+
...otherOpts,
54+
url: this._baseUrl() + path,
55+
headers: {
56+
"X-API-KEY": `${this.$auth.api_key}`,
57+
"Content-Type": "application/json",
58+
...headers,
59+
},
60+
});
61+
},
62+
async writePersonalizedContent(args = {}) {
63+
return this._makeRequest({
64+
path: "/generate-content/v3.5",
65+
method: "post",
66+
...args,
67+
});
968
},
1069
},
1170
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export default {
2+
CONTENT_TYPES: [
3+
"email",
4+
"opener",
5+
"sms",
6+
"connectionRequest",
7+
"callScript",
8+
"sequence",
9+
],
10+
WRITING_STYLES: [
11+
{
12+
label: "For a conversational and insightful approach",
13+
value: "challenger_sale",
14+
},
15+
{
16+
label: "To craft content with a creative, poetic twist",
17+
value: "clever_poet",
18+
},
19+
{
20+
label: "For concise, executive-level pitches",
21+
value: "cxo_pitch",
22+
},
23+
{
24+
label: "For content backed by data, statistics, and clear ROI",
25+
value: "data_driven",
26+
},
27+
{
28+
label: "For short, personalized content that follows Basho protocol",
29+
value: "basho",
30+
},
31+
{
32+
label: "Demonstrates a sense of urgency tied to the prospect's pain points",
33+
value: "why_you_why_now",
34+
},
35+
],
36+
};

components/autobound/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/autobound",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Autobound Components",
55
"main": "autobound.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
1518
}

pnpm-lock.yaml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)