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
@@ -0,0 +1,64 @@
import app from "../../autobound.app.mjs";

export default {
key: "autobound-write-personalized-content",
name: "Write Personalized Content",
description: "Write personalized content using Autobound. [See the documentation](https://autobound-api.readme.io/docs/generate-personalized-content-copy)",
version: "0.0.1",
type: "action",
props: {
app,
contentType: {
propDefinition: [
app,
"contentType",
],
},
contactEmail: {
propDefinition: [
app,
"contactEmail",
],
},
userEmail: {
propDefinition: [
app,
"userEmail",
],
},
writingStyle: {
propDefinition: [
app,
"writingStyle",
],
},
additionalContext: {
propDefinition: [
app,
"additionalContext",
],
},
wordCount: {
propDefinition: [
app,
"wordCount",
],
},
},

async run({ $ }) {
const response = await this.app.writePersonalizedContent({
$,
data: {
contactEmail: this.contactEmail,
userEmail: this.userEmail,
contentType: this.contentType,
writingStyle: this.writingStyle,
additionalContext: this.additionalContext,
wordCount: this.wordCount,
},
});
$.export("$summary", "Successfully generated personalized content");
return response;
},
};
67 changes: 63 additions & 4 deletions components/autobound/autobound.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,70 @@
import { axios } from "@pipedream/platform";
import constants from "./common/constants.mjs";

export default {
type: "app",
app: "autobound",
propDefinitions: {},
propDefinitions: {
contactEmail: {
type: "string",
label: "Contact Email",
description: "The email address of the contact the user is reaching out to",
},
userEmail: {
type: "string",
label: "User Email",
description: "The email address of the user the content is written on behalf of",
},
contentType: {
type: "string",
label: "Content Type",
description: "Type of content to generate",
options: constants.CONTENT_TYPES,
},
writingStyle: {
type: "string",
label: "Writing Style",
description: "Writing style for content generation",
options: constants.WRITING_STYLES,
},
additionalContext: {
type: "string",
label: "Additional Context",
description: "Extra information for customizing generated content",
},
wordCount: {
type: "integer",
label: "Word Count",
description: "Approximate word count for output",
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.autobound.ai/api/external";
},
async _makeRequest(opts = {}) {
const {
$ = this,
path,
headers,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
"X-API-KEY": `${this.$auth.api_key}`,
"Content-Type": "application/json",
...headers,
},
});
},
async writePersonalizedContent(args = {}) {
return this._makeRequest({
path: "/generate-content/v3.5",
method: "post",
...args,
});
},
},
};
36 changes: 36 additions & 0 deletions components/autobound/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export default {
CONTENT_TYPES: [
"email",
"opener",
"sms",
"connectionRequest",
"callScript",
"sequence",
],
WRITING_STYLES: [
{
label: "For a conversational and insightful approach",
value: "challenger_sale",
},
{
label: "To craft content with a creative, poetic twist",
value: "clever_poet",
},
{
label: "For concise, executive-level pitches",
value: "cxo_pitch",
},
{
label: "For content backed by data, statistics, and clear ROI",
value: "data_driven",
},
{
label: "For short, personalized content that follows Basho protocol",
value: "basho",
},
{
label: "Demonstrates a sense of urgency tied to the prospect's pain points",
value: "why_you_why_now",
},
],
};
5 changes: 4 additions & 1 deletion components/autobound/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/autobound",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Autobound Components",
"main": "autobound.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading