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,112 @@
import rejoiner from "../../rejoiner.app.mjs";

export default {
key: "rejoiner-add-customer-to-list",
name: "Add Customer to List",
description: "Adds a customer to a specific list, or if the customer already exists, will update the record of that customer with the supplied data. [See the documentation](https://docs.rejoiner.com/reference/add-customer-to-list)",
version: "0.0.1",
type: "action",
props: {
rejoiner,
listId: {
propDefinition: [
rejoiner,
"listId",
],
},
email: {
propDefinition: [
rejoiner,
"email",
],
},
firstName: {
propDefinition: [
rejoiner,
"firstName",
],
},
lastName: {
propDefinition: [
rejoiner,
"lastName",
],
},
phone: {
propDefinition: [
rejoiner,
"phone",
],
},
timezone: {
propDefinition: [
rejoiner,
"timezone",
],
},
language: {
propDefinition: [
rejoiner,
"language",
],
},
address1: {
propDefinition: [
rejoiner,
"address1",
],
},
address2: {
propDefinition: [
rejoiner,
"address2",
],
},
city: {
propDefinition: [
rejoiner,
"city",
],
},
state: {
propDefinition: [
rejoiner,
"state",
],
},
postalCode: {
propDefinition: [
rejoiner,
"postalCode",
],
},
country: {
propDefinition: [
rejoiner,
"country",
],
},
},
async run({ $ }) {
const response = await this.rejoiner.addCustomerToList({
$,
listId: this.listId,
data: {
email: this.email,
first_name: this.firstName,
last_name: this.lastName,
phone: this.phone,
timezone: this.timezone,
language: this.language,
address1: this.address1,
address2: this.address2,
city: this.city,
state: this.state,
postal_code: this.postalCode,
country: this.country,
},
});
$.export("$summary", `Added customer ${this.email} to list ${this.listId}`);
return response;
},
};
46 changes: 46 additions & 0 deletions components/rejoiner/actions/start-journey/start-journey.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import rejoiner from "../../rejoiner.app.mjs";

export default {
key: "rejoiner-start-journey",
name: "Start Journey",
description: "Triggers the beginning of a customer journey in Rejoiner. [See the documentation](https://docs.rejoiner.com/reference/trigger-webhook-journey)",
version: "0.0.1",
type: "action",
props: {
rejoiner,
webhookUrl: {
type: "string",
label: "Webhook Endpoint URL",
description: "Webhook URL of the journey. A webhook-triggered journey will provide an explicit Webhook Endpoint URL to be used for triggering the journey",
},
email: {
propDefinition: [
rejoiner,
"email",
],
},
metadata: {
type: "object",
label: "Metadata",
description: "Metadata to be attached to the customer's journey session metadata",
optional: true,
},
},
async run({ $ }) {
const response = await this.rejoiner._makeRequest({
$,
method: "POST",
url: this.webhookUrl,
data: {
email: this.email,
session_data: this.metadata
? typeof this.metadata === "string"
? JSON.parse(this.metadata)
: this.metadata
: undefined,
},
});
$.export("$summary", `Triggered journey for customer ${this.email}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import rejoiner from "../../rejoiner.app.mjs";

export default {
key: "rejoiner-update-customer-profile",
name: "Update Customer Profile",
description: "Updates a customer's profile information. [See the documentation](https://docs.rejoiner.com/reference/update-customer-profile)",
version: "0.0.1",
type: "action",
props: {
rejoiner,
email: {
propDefinition: [
rejoiner,
"email",
],
},
firstName: {
propDefinition: [
rejoiner,
"firstName",
],
},
lastName: {
propDefinition: [
rejoiner,
"lastName",
],
},
phone: {
propDefinition: [
rejoiner,
"phone",
],
},
timezone: {
propDefinition: [
rejoiner,
"timezone",
],
},
language: {
propDefinition: [
rejoiner,
"language",
],
},
address1: {
propDefinition: [
rejoiner,
"address1",
],
},
address2: {
propDefinition: [
rejoiner,
"address2",
],
},
city: {
propDefinition: [
rejoiner,
"city",
],
},
state: {
propDefinition: [
rejoiner,
"state",
],
},
postalCode: {
propDefinition: [
rejoiner,
"postalCode",
],
},
country: {
propDefinition: [
rejoiner,
"country",
],
},
},
async run({ $ }) {
const response = await this.rejoiner.updateCustomerProfile({
$,
params: {
email: this.email,
},
data: {
first_name: this.firstName,
last_name: this.lastName,
phone: this.phone,
timezone: this.timezone,
language: this.language,
address1: this.address1,
address2: this.address2,
city: this.city,
state: this.state,
postal_code: this.postalCode,
country: this.country,
},
});
$.export("$summary", `Updated customer profile for customer ${this.email}`);
return response;
},
};
7 changes: 5 additions & 2 deletions components/rejoiner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/rejoiner",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Rejoiner Components",
"main": "rejoiner.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"
}
}
}
Loading
Loading