Skip to content

New Components - bloomerang #16105

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 9 commits into from
Apr 9, 2025
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
2 changes: 1 addition & 1 deletion components/adyntel/adyntel.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/agentset/agentset.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
72 changes: 72 additions & 0 deletions components/bloomerang/actions/add-interaction/add-interaction.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import bloomerang from "../../bloomerang.app.mjs";
import {
CHANNEL_OPTIONS, PURPOSE_OPTIONS,
} from "../../common/constants.mjs";

export default {
key: "bloomerang-add-interaction",
name: "Add Interaction",
description: "Adds an interaction to an existing constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions/post_interaction)",
version: "0.0.1",
type: "action",
props: {
bloomerang,
constituentId: {
propDefinition: [
bloomerang,
"constituentId",
],
},
date: {
type: "string",
label: "Date",
description: "The date of the interaction",
},
subject: {
type: "string",
label: "Subject",
description: "The subject od the interation",
},
channel: {
type: "string",
label: "Channel",
description: "The channel of the interation",
options: CHANNEL_OPTIONS,
},
purpose: {
type: "string",
label: "Purpose",
description: "The purpose of the interation",
options: PURPOSE_OPTIONS,
},
note: {
type: "string",
label: "Note",
description: "Note for the interaction",
optional: true,
},
isInbound: {
type: "boolean",
label: "Is Inbound",
description: "Was the interaction initiated by constituent?",
optional: true,
},
},
async run({ $ }) {
const response = await this.bloomerang.createInteraction({
$,
data: {
AccountId: this.constituentId,
Date: this.date,
Subject: this.subject,
Channel: this.channel,
Purpose: this.purpose,
note: this.note,
IsInbound: this.isInbound,
},
});

$.export("$summary", `Successfully added interaction with ID ${response.Id}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
import bloomerang from "../../bloomerang.app.mjs";
import {
COMMUNICATION_CHANNEL_OPTIONS,
CONSTITUENT_GENDER_OPTIONS,
CONSTITUENT_PREFIX_OPTIONS,
CONSTITUENT_STATUS_OPTIONS,
CONSTITUENT_SUFFIX_OPTIONS,
CONSTITUENT_TYPE_OPTIONS,
} from "../../common/constants.mjs";

export default {
key: "bloomerang-create-constituent",
name: "Create Constituent",
description: "Creates a new constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/post_constituent)",
version: "0.0.1",
type: "action",
props: {
bloomerang,
type: {
type: "string",
label: "Constituent Type",
description: "Filter constituents by type",
options: CONSTITUENT_TYPE_OPTIONS,
reloadProps: true,
},
status: {
type: "string",
label: "Status",
description: "The status of the constituent",
options: CONSTITUENT_STATUS_OPTIONS,
optional: true,
},
fullName: {
type: "string",
label: "Organization Name",
description: "The organization's name of the constituent",
hidden: true,
},
firstName: {
type: "string",
label: "First Name",
description: "The first name of the constituent",
hidden: true,
},
lastName: {
type: "string",
label: "Last Name",
description: "The last name of the constituent",
hidden: true,
},
middleName: {
type: "string",
label: "Middle Name",
description: "The middle name of the constituent",
optional: true,
},
prefix: {
type: "string",
label: "Title",
description: "The prefix of the constituent",
options: CONSTITUENT_PREFIX_OPTIONS,
optional: true,
},
suffix: {
type: "string",
label: "Suffix",
description: "The suffix of the constituent",
options: CONSTITUENT_SUFFIX_OPTIONS,
optional: true,
},
jobTitle: {
type: "string",
label: "Job Title",
description: "The job title of the constituent",
optional: true,
},
gender: {
type: "string",
label: "Gender",
description: "The gender of the constituent",
options: CONSTITUENT_GENDER_OPTIONS,
optional: true,
},
birthdate: {
type: "string",
label: "Birthdate",
description: "The birth date of the constituent",
optional: true,
},
employer: {
type: "string",
label: "Employer",
description: "The employer of the constituent",
optional: true,
},
website: {
type: "string",
label: "Website",
description: "An website of the constituent",
optional: true,
},
facebookId: {
type: "string",
label: "Facebook",
description: "The constituent's facebook page",
optional: true,
},
twitterId: {
type: "string",
label: "Twitter ID",
description: "The constituent's twitter ID",
optional: true,
},
linkedInId: {
type: "string",
label: "LinkedIn",
description: "The constituent's linkedIn page",
optional: true,
},
preferredCommunicationChannel: {
type: "string",
label: "Preferred Communication Channel",
description: "The preferred comunication channel of the constituent",
options: COMMUNICATION_CHANNEL_OPTIONS,
optional: true,
},
},
async additionalProps(props) {
const isIndividual = this.type === "Individual";
props.firstName.hidden = !isIndividual;
props.lastName.hidden = !isIndividual;
props.fullName.hidden = isIndividual;
return {};
},
async run({ $ }) {
const data = {
Type: this.type,
Status: this.status,
Prefix: this.prefix,
Suffix: this.suffix,
JobTitle: this.jobTitle,
Gender: this.gender,
Birthdate: this.birthdate,
Employer: this.employer,
Website: this.website,
FacebookId: this.facebookId,
TwitterId: this.twitterId,
LinkedInId: this.linkedInId,
PreferredCommunicationChannel: this.preferredCommunicationChannel,
};
if (this.type === "Individual") {
data.FirstName = this.firstName;
data.LastName = this.lastName;
data.MiddleName = this.middleName;
} else {
data.FullName = this.fullName;
}

const response = await this.bloomerang.createConstituent({
$,
data,
});

$.export("$summary", `Successfully created constituent with ID ${response.Id}`);
return response;
},
};
85 changes: 85 additions & 0 deletions components/bloomerang/actions/create-donation/create-donation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import bloomerang from "../../bloomerang.app.mjs";
import { PAYMENT_METHOD_OPTIONS } from "../../common/constants.mjs";

export default {
key: "bloomerang-create-donation",
name: "Create Donation",
description: "Creates a new donation record in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)",
version: "0.0.1",
type: "action",
props: {
bloomerang,
constituentId: {
propDefinition: [
bloomerang,
"constituentId",
],
},
date: {
type: "string",
label: "Date",
description: "The date of the donation",
},
amount: {
type: "string",
label: "Amount",
description: "The amount for the donation",
},
fundId: {
propDefinition: [
bloomerang,
"fundId",
],
},
paymentMethod: {
type: "string",
label: "Payment Method",
description: "The method of payment",
options: PAYMENT_METHOD_OPTIONS,
},
campaignId: {
propDefinition: [
bloomerang,
"campaignId",
],
optional: true,
},
appealId: {
propDefinition: [
bloomerang,
"appealId",
],
optional: true,
},
note: {
type: "string",
label: "Note",
description: "A note for the donation",
optional: true,
},
},
async run({ $ }) {
const response = await this.bloomerang.createDonation({
$,
data: {
AccountId: this.constituentId,
Date: this.date,
Amount: this.amount,
Method: this.paymentMethod,
Designations: [
{
FundId: this.fundId,
Amount: this.amount,
Type: "Donation",
CampaignId: this.campaignId,
AppealId: this.appealId,
Note: this.note,
},
],
},
});

$.export("$summary", `Successfully created donation with ID: ${response.Id}`);
return response;
},
};
Loading
Loading