Bloomerang.js
Bloomerang.js uses a public key API. It takes information from a form and submits it to an API endpoint on Bloomerang’s servers. It allows anyone to add donations and interactions to Bloomerang. Only constituent records can be updated, such as with a new address. These characteristics make Bloomerang.js perfect for online forms. You can also use Bloomerang Payments to avoid processing credit cards yourself.
- Required Functions
- Data Functions
-
Account
- individual
- organization
- organizationName
- firstName
- middleName
- lastName
- prefix
- suffix
- informalName
- formalName
- envelopeName
- recognitionName
- jobTitle
- employer
- website
- linkedinID
- gender
- birthdate
- homePhone
- workPhone
- setPhone
- homeEmail
- workEmail
- setEmail
- homeAddress
- workAddress
- setAddress
- customFreeformField
- customPickField
- clearCustomFields
- Donation
- Recurring Donation
- Credit Cards
- In Kind
- Check
- EFT
- Interaction
- Submission Data Functions
Required Functions
You must call the following functions for successful online donation submissions:
- Bloomerang.useKey
- Bloomerang.useProcessor
- Bloomerang.useDonationId
Forms created through the application automatically call Bloomerang.useKey and Bloomerang.useProcessor, if necessary.
Bloomerang.useKey(publicKey)
This function uses the public key to submit the form to the correct organization. Get the public key by clicking Settings, View All Settings, and then Edit on the Organization tile in Bloomerang.
publicKey |
required | A string that begins with |
Bloomerang.useProcessor(id, type, publicKey, isTestMode, bluePayTPS, restrictBPCredit)
Tells Bloomerang which processor to post the credit card or EFT information to. Use this function only if the form uses BluePay and supports EFT. Otherwise, Spreedly handles credit card processing.
id |
required | The Bloomerang ID of the processor. Get the ID by clicking Settings, View All Settings in Bloomerang. Click Edit on the Transactions tile, and then Credit Card Processors. Also see How to Get Bloomerang IDs. |
type |
required | Valid value is |
publicKey |
required | The BluePay processor’s public key. Find this in the Account ID field of the processor’s page in Bloomerang. |
isTestMode |
optional | A boolean value telling whether the processor is in test mode. Defaults to |
bluePayTPS |
required | The MD5 hash of the string concatenation of the BluePay private key and the string |
restrictBPCredit |
required | A boolean value. Must be true. Ensures that bad guys can’t use the BluePay TPS to authorize credit cards fraudulently. |
Bloomerang.useDonationId(id)
Tells Bloomerang which donation form you are using.
id |
required | The ID associated with this form. See How to Get Bloomerang IDs. |
Data Functions
The following functions set the data on the Bloomerang object model:
The data is sent to Bloomerang via the form submission functions.
Account Data Functions
These functions set information on the constituent account.
Bloomerang.Account.individual()
Sets the account type of the constituent to Individual
(a person, not an organization).
Bloomerang.Account.organization()
Sets the account type of the constituent to Organization (not an individual).
Bloomerang.Account.organizationName(name)
Sets the full name of the organization. Also calls Bloomerang.Account.organization()
to set the type of the account to Organization
.
name |
required | The full name of the organization |
Bloomerang.Account.firstName(name)
Sets the constituent’s first name. This does not set the account type to Individual
. If the account is already set to Organization
, first call Bloomerang.Account.individual()
.
name |
required | The constituent’s first name |
Bloomerang.Account.middleName(name)
Sets the constituent’s middle name. This does not set the account type to Individual. If the account is already set to Organization, first call Bloomerang.Account.individual().
name |
required | The constituent’s middle name |
Bloomerang.Account.lastName(name)
Sets the constituent’s last name. This does not set the account type to Individual. If the account is already set to Organization, first call Bloomerang.Account.individual().
name |
required | The constituent’s last name |
Bloomerang.Account.prefix(value)
Sets the constituent’s name prefix. This does not set the account type to Individual. If the account is already set to Organization, first call Bloomerang.Account.individual().
value |
required | The constituent’s name prefix. Valid values are: Mr, Miss, Ms, Mrs, Master, Rev, Pastor, Fr, Dr, Atty, Prof, Hon, Pres, Coach , Gov, Sir, Rep, Sen, Pvt, Sgt, Maj, Capt, Cmdr, Lt, Col, Gen, Rabbi, Sr |
Bloomerang.Account.suffix(value)
Sets the constituent’s name suffix. This does not set the account type to Individual. If the account is already set to Organization, first call Bloomerang.Account.individual().
value |
required | The constituent’s name suffix. Valid values are: Jr, Sr, II, III, IV, V, Esq, PhD, MD, DDS |
Bloomerang.Account.informalName(name)
Sets the constituent’s informal name. This does not set the account type to Individual. If the account is already set to Organization, first call Bloomerang.Account.individual().
If this is not called, the informal name defaults to the constituent’s first name.
name |
required | The constituent’s informal name |
Bloomerang.Account.formalName(name)
Sets the constituent’s formal name. This does not set the account type to Individual. If the account is already set to Organization, first call “a href=”https://bloomerang.co/product/integrations-data-management/api/bloomerang-js/#bloomerang-account-individual”> Bloomerang.Account.individual().
If this is not called, the informal name defaults to prefix lastName. If no prefix is specified, it defaults to firstName lastName.
name |
required | The constituent’s formal name |
Bloomerang.Account.envelopeName(name)
Sets the constituent’s envelope name. This is the name that should be printed on mailing labels. This does not set the account type to Individual. If the account is already set to Organization, first call Bloomerang.Account.individual().
If this is not called, the envelope name defaults to prefix firstName lastName suffix.
name |
required | The constituent’s envelope name |
Bloomerang.Account.recognitionName(name)
Sets the constituent’s recognition name. This does not set the account type to Individual. If the account is already set to Organization, first call Bloomerang.Account.individual().
If this is not called, the recognition name defaults to prefix firstName middleName lastName suffix.
name |
required | The constituent’s recognition name |
Bloomerang.Account.jobTitle(title)
Sets the constituent’s job title.
title |
required | The constituent’s job title |
Bloomerang.Account.employer(name)
Sets the name of the constituent’s employer.
name |
required | The constituent’s employer |
Sets the constituent’s website.
url |
required | The URL of the constituent’s website |
Bloomerang.Account.facebook(id)
Sets the constituent’s Facebook account.
id |
required | The constituent’s Facebook page URL |
Bloomerang.Account.twitter(id)
Set the constituent’s Twitter account.
id |
required | The constituent’s Twitter handle |
Bloomerang.Account.linkedInId(id)
Sets the constituent’s LinkedIn account.
id |
required | The constituent’s LinkedIn URL |
Bloomerang.Account.gender(value)
Sets the constituent’s gender.
value |
required | The constituent’s gender. Valid values are Male, Female, or Other |
Bloomerang.Account.birthdate(date)
Sets the constituent’s date of birth.
date |
required | The constituent’s date of birth. String in yyyy-mm-dd format. |
Bloomerang.Account.homePhone(number,ext)
Sets the constituent’s primary phone number, with a type of Home. Shortcut for Bloomerang.Account.setPhone(Home). You can only set one phone number on a constituent via forms.
When the phone number is submitted, it is added as a new phone number and marked as primary. If the constituent already has that phone number, it is marked as primary.
number |
required | The constituent’s phone number. String. Add + in front of an international number. For example, +82112223333 |
ext |
optional | The phone number’s extension |
Sets the constituent’s primary phone number, with a type of Work. Shortcut for Bloomerang.Account.setPhone(Work). You can only set one phone number on a constituent via forms.
When the phone number is submitted, it is added as a new phone number and marked as primary. If the constituent already has that phone number, it is marked as primary.
number |
required | The constituent’s phone number. String. Add + in front of an international number. For example, +82112223333 |
ext |
optional | The phone number’s extension. |
Bloomerang.Account.setPhone(type, number, ext)
Sets the constituent’s primary phone number and specifies the type. You can only set one phone number on a constituent via forms.
When the phone number is submitted, it is added as a new phone number and marked as primary. If the constituent already has that phone number, it is marked as primary.
type |
required | The type of phone number. Valid values are Home, Work, Mobile, or Fax |
number |
required | The constituent’s phone number. String. Add + in front of an international number. For example, +82112223333. |
ext |
optional | The phone number’s extension |
Bloomerang.Account.homeEmail(address)
Sets the constituent’s primary email address, with a type of Home. Shortcut for Bloomerang.Account.setEmail(“Home”, address). You can only set one email address on a constituent via forms.
When the email address is submitted, it is added as a new email address and marked as primary. If the constituent already has that email address, it is marked as primary.
address |
required | The constituent’s home email address |
Bloomerang.Account.workEmail(address)
Sets the constituent’s primary email address, with a type of Work. Shortcut for Bloomerang.Account.setEmail(“Work”, address) . You can only set one email address on a constituent via forms.
When the email address is submitted, it is added as a new email address and marked as primary. If the constituent already has that email address, it is marked as primary.
Bloomerang.Account.setEmail(type, address)
Sets the constituent’s primary email address and specifies the type. You can only set one email address on a constituent via forms.
When the email address is submitted, it is added as a new email address and marked as primary. If the constituent already has that email address, it is marked as primary.
type |
required | The type of email address. Valid values are Home or Work. |
address |
required | The constituent’s email address |
Bloomerang.Account.homeAddress(street, city, state, zip, country)
Sets the constituent’s primary address, with a type of Home. Shortcut for < a href="https://bloomerang.co/product/integrations-data-management/api/bloomerang-js/#bloomerang-account-setaddress">Bloomearng.Account.setAddress(home). You can only set one address on a constituent via forms.
If the constituent already has an address, Bloomerang normalizes the submitted address. (“123 North 4th Street” becomes “123 N 4TH ST”.) Then it compares the normalized address with the existing addresses. If a match is found, the existing address is updated and marked as primary. If not, a new address is added and marked as primary.
If the country is not United States, Canada, or Bermuda, put the entire address in the street argument. Don’t use city, state, or zip.
street |
required | The street part of the constituent’s address (123 4th Street). |
city |
optional | The city part of the constituent’s address (Indianapolis). |
state |
optional | The state part of the constituent’s address (Indiana). We recommend using state abbreviations (IN). |
zip |
optional | The ZIP code for the constituent’s address (46216). |
country |
optional | The country for the constituent’s address. We recommend using the 2- or 3-digit country code. See https://www.iso.org/obp/ui/#search. Default is US. |
Bloomerang.Account.workAddress(street, city, state, zip, country)
Sets the constituent’s primary address, with a type of Work. Shortcut for Bloomerang.Account.setAddress(Work). You can only set one address on a constituent via forms.
If the constituent already has an address, Bloomerang normalizes the submitted address. (“123 North 4th Street” becomes “123 N 4TH ST”.) Then it compares the normalized address with the existing addresses. If a match is found, the existing address is updated and marked as primary. If not, a new address is added and marked as primary.
If the country is not United States, Canada, or Bermuda, put the entire address in the street argument. Don’t use city, state, or zip.
street |
required | The street part of the constituent’s address (123 4th Street) |
city |
optional | The city part of the constituent’s address (Indianapolis) |
state |
optional | The state part of the constituent’s address (Indiana). We recommend using state abbreviations (IN). |
zip |
optional | The ZIP code for the constituent’s address (46216) |
country |
optional | The country for the constituent’s address. We recommend using the 2- or 3-digit country code. See https://www.iso.org/obp/ui/#search. Default is US. |
Bloomerang.Account.setAddress(type, street, city, state, zip, country)
Sets the constituent’s primary address and specifies the type. You can only set one address on a constituent via forms.
If the constituent already has an address, Bloomerang normalizes the submitted address. (“123 North 4th Street” becomes “123 N 4TH ST”.) Then it compares the normalized address with the existing addresses. If a match is found, the existing address is updated and marked as primary. If not, a new address is added and marked as primary.
If the country is not United States, Canada, or Bermuda, put the entire address in the street argument. Don’t use city, state, or zip.
type |
required | The type of address. Valid values are Home, Work, Vacation. |
street |
required | The street part of the constituent’s address (123 4th Street) |
city |
optional | The city part of the constituent’s address (Indianapolis) |
state |
optional | The state part of the constituent’s address (Indiana). We recommend using state abbreviations (IN). |
zip |
optional | The ZIP code for the constituent’s address (46216) |
country |
optional | The country for the constituent’s address. We recommend using the 2- or 3-digit country code. See https://www.iso.org/obp/ui/#search. Default is US. |
Bloomerang.Account.customFreeformField (field, value)
Sets a freeform custom field on the constituent account.
fieldID |
required | The ID of the custom field |
value |
required | The value ( a string, number, or date) that should be set for the field |
Bloomerang.Account.customPickField (fieldID, valueID1, ValueID2, …)
Sets a pick one or pick multiple custom field on the constituent account.
For a pick one field, only pass in one value’s ID. This value replaces an existing value for that field.
For a pick multiple field, you can pass in as many value IDs as there are defined values. Each value is a separate argument. Submitted values replace any existing values for that field.
fieldID |
required | The ID of the field |
valueID |
required | The IDs of the values that should be set for the field |
Bloomerang.Account.clearCustomFields()
Clears all the custom field values on the account. Call this function to remove any selections left over from a previous submission attempt. Then update the custom fields with values from the form.
This does not delete any custom field values in the Bloomerang database.
Donation Data Functions
These functions set information on the submitted donation.
Bloomerang.Donation.date(date)
Depreciated. Bloomerang automatically uses the date the donation was submitted.
Bloomerang.Donation.note(text)
Sets the Note field on the donation.
text |
required | The note to be added to the transaction. String, up to 64KB in length. |
Bloomerang.Donation.amount(amount)
Sets the donation amount.
amount |
required | The amount of the donation. String (with U.S. formatting, $5.00) or number (5). |
Bloomerang.Donation.nonDeductible(amount)
Sets the nondeductible part of the donation amount. (The tax-deductible part is amount
minus nonDeductible
.)
amount |
required | The nondeductible amount. Number. |
Bloomerang.Donation.fundID(id)
Sets the fund for the donation.
If the submitted fund does not exist in Bloomerang, the transaction defaults to the form’s first fund.
id |
required | The fund’s Bloomerang ID |
Bloomerang.Donation.campaign(name)
Sets the campaign for the donation. This overrides any campaign set in the Bloomerang form builder.
This function does not create campaigns in Bloomerang! You must first create the campaign in Bloomerang and then use the exact name on your form.
name |
required | The name of the campaign as set in Bloomerang. If the name changes, you must update the form to use the new name. Defaults to the campaign set in Bloomerang’s form builder. |
Bloomerang.Donation.appeal(name)
Sets the appeal for the donation. This overrides any appeal set in the Bloomerang form builder.
This function does not create appeals in Bloomerang! You must first create the appeal in Bloomerang and then use the exact name on your form.
name |
required | The name of the appeal as set in Bloomerang. If the name changes, you must update the form to use the new name. Defaults to the appeal set in Bloomerang’s form builder. |
Bloomerang.Donation.tribute(name)
Sets the tribute for the donation.
This function does not create tributes in Bloomerang! You must first create the tribute in Bloomerang and then use the exact name on your form.
name |
required | The name of the existing tribute as set in Bloomerang. If the name changes, you must update the form to use the new name. |
Bloomerang.Donation.tributeType(name)
Sets the donation’s tribute type.
name |
required | The name of the tribute type. Valid values are In Honor of, In Memory of. |
Bloomerang.Donation.customFreeformField(fieldID, value)
Sets a custom field on the donation. The constituent can type anything into this field.
fieldID |
required | The field’s Bloomerang ID |
value |
required | Valid formats are string, number, date |
Bloomerang.Donation.customPickField(fieldID, valueID1, valueID2, …)
Sets a custom field on the donation. The constituent can pick one or more values. This depends on how the field was created in Bloomerang.
This function replaces the field’s values on the JavaScript object.
fieldID |
required | The field’s Bloomerang ID |
valueID(s) |
required | The values’ Bloomerang IDs. For pick one fields, pass in one valueId. For pick multiple fields, you can pass in multiple valueIds, each as a separate argument. |
Bloomerang.Donation.clearCustomFields()
Clears all the custom field values for the donation. Call this function to remove any selections left over from a previous submission attempt. Then update the custom fields with values from the form.
This does not delete any custom field values in the Bloomerang database.
Recurring Donation Data Functions
These functions set data on a recurring donation.
Bloomerang.RecurringDonation.date(date)
Depreciated. Bloomerang automatically uses the date the recurring donation was submitted.
The start date of a recurring donation is set using Bloomerang.RecurringDonation.startDate
.
Bloomerang.RecurringDonation.note(text)
Sets the Note field on the recurring donation.
text |
required | The note to be added to the transaction. String, up to 64KB in length. |
Bloomerang.RecurringDonation.amount(amount)
Sets the amount of the recurring donation. The amount is charged at each interval specified by Bloomerang.RecurringDonation.frequency(value).
amount |
required | The amount of recurring donation |
Bloomerang.RecurringDonation.nonDeductible(amount)
Sets the nondeductible part of the recurring donation amount. (The tax-deductible part is amount minus nonDeductible.)
amount |
required | The nondeductible amount. Number. Does not accept strings. |
Bloomerang.RecurringDonation.fundID(id)
Sets the fund for the recurring donation.
If the submitted fund does not exist in Bloomerang, the transaction defaults to the form’s first fund.
id |
required | The fund’s Bloomerang ID |
Bloomerang.RecurringDonation.campaign(name)
Sets the campaign for the recurring donation. This overrides any campaign set in the Bloomerang form builder.
This function does not create campaigns in Bloomerang! You must first create the campaign in Bloomerang and then use the exact name on your form.
name |
required | The name of the campaign as set in Bloomerang. If the name changes, you must update the form to use the new name. Defaults to the campaign set in Bloomerang’s form builder. |
Bloomerang.RecurringDonation.appeal(name)
Sets the appeal for the recurring donation. This overrides any appeal set in the Bloomerang form builder.
This function does not create appeals in Bloomerang! You must first create the appeal in Bloomerang and then use the exact name on your form.
name |
required | The name of the appeal as set in Bloomerang. If the name changes, you must update the form to use the new name. Defaults to the appeal set in Bloomerang’s form builder. |
Bloomerang.RecurringDonation.tribute(name)
Sets the tribute that should be used for the current recurring donation.
This function does not create tributes in Bloomerang! You must first create the tribute in Bloomerang and then use the exact name on your form.
name |
required | The name of the existing tribute as set in Bloomerang. If the name changes, you must update the form to use the new name. |
Bloomerang.RecurringDonation.tributeType(name)
Sets the recurring donation’s tribute type.
name |
required | The name of the tribute type. Valid values are In Honor of, In Memory of. |
Bloomerang.RecurringDonation.frequency(value)
Sets how often the recurring donation should occur.
value |
required | The frequency of the recurring donation. Valid values are Weekly, Monthly, Quarterly, Yearly. Invalid values default to Monthly. |
Bloomerang.RecurringDonation.weekly()
Sets the recurring donation to happen weekly. Shortcut for Bloomerang.RecurringDonation.frequency(“Weekly”).
Bloomerang.RecurringDonation.monthly()
Sets the recurring donation to happen monthly. Shortcut for Bloomerang.RecurringDonation.frequency(“Monthly”).
Bloomerang.RecurringDonation.quarterly()
Sets the recurring donation to happen quarterly. Shortcut for Bloomerang.RecurringDonation.frequency(“Quarterly”).
Bloomerang.RecurringDonation.yearly()
Sets the recurring donation to happen yearly. Shortcut for Bloomerang.RecurringDonation.frequency(“Yearly”).
Bloomerang.RecurringDonation.startDate(date)
Sets the date when the recurring donation should start processing payments. This is not the same as Bloomerang.RecurringDonation.date, which is when the form was submitted.
If the start date is the same as the current date, the first payment processes immediately. Otherwise, it occurs in the early morning of the start date (UTC time).
Time zones can set the start date earlier than the donation’s date. If this happens, Bloomerang changes the start date to match the donation’s date. The payment processes immediately.
date |
required | The date on which the recurring donation should start processing donations. String in yyyy-mm-dd format. |
Bloomerang.RecurringDonation.customFreeformField (fieldID, value)
Sets a custom field on the recurring donation. The constituent can type anything into this field.
fieldID |
required | The field’s Bloomerang ID |
value |
required | Valid formats are string, number, date |
Bloomerang.RecurringDonation.customPickField(fieldId, value1, value2, …)
Sets a custom field on the donation. The constituent can pick one or more values. This depends on how the field was created in Bloomerang.
This function replaces the field’s values on the JavaScript object.
fieldID |
required | The field’s Bloomerang ID. |
valueId(s) |
required | The values’ Bloomerang IDs. For pick one fields, pass in one valueId. For pick multiple fields, you can pass in multiple valueIds, each as a separate argument. |
Bloomerang.RecurringDonation.clearCustomFields()
Clears all the custom fields for the donation. Call this function to remove any selections left over from a previous submission attempt. Then update the custom fields with values from the form.
This does not delete any custom field values in the Bloomerang database.
Credit Card Data Functions
The CreditCard functions set the credit card data submitted to Bloomerang. Bloomerang does not process credit card data for security reasons. Instead, Bloomerang requires a Spreedly token.
All these functions set the payment method to CreditCard. A donation can only have one payment method. For example, a donation cannot be both credit card and in kind.
Sets the Spreedly token for processing a credit card. Spreedly is a service that reduces PCI compliance scope by securely handling credit card processing.Bloomerang recommends you use the Spreedly Express Payment Widget to obtain a Spreedly token.
token |
required | The Spreedly token that should be charged. |
Bloomerang.CreditCard.expirationMonth(month)
The month the credit card expires.
month |
required | The expiration month. |
Bloomerang.CreditCard.expirationYear(year)
The year the credit card expires.
year |
required | The expiration year. |
In Kind Data Functions
The InKind functions allow you to set properties for in-kind gifts. These are gifts of goods and services, not money.
All these functions set the payment method to InKind. A donation can only have one payment method. For example, a donation cannot be both credit card and in kind.
Bloomerang.InKind.marketValue(value)
The gift’s fair market value.
value |
required | The gift’s fair market value. String in U.S. formatting, or number. |
Blomerang.InKind.description(text)
text |
required | The description of the gift. Up to 255 characters. |
Bloomerang.InKind.type(type)
Sets the type of gift (whether it was goods or services).
type |
required | The type of gift. Valid values are Goods, Services. |
Bloomerang.InKind.goods()
Sets the gift type to Goods. Shortcut for Bloomerang.InKind.type(“Goods”).
Bloomerang.InKind.services()
Sets the gift type to Services. Shortcut for Bloomerang.InKind.type(“Services”).
Check Data Functions
The Check functions set properties for a donation made by check.
All these functions set the payment method to Check. A donation can only have one payment method. For example, a donation cannot be both credit card and check.
Bloomerang does not process checks online. You will need to deposit physical checks outside of Bloomerang. To allow constituents to pay electronically using a checking account, use EFT. See Eft Data Functions for details.
Bloomerang.Check.number(number)
Sets the check number.
number |
required | The check number |
Bloomerang.Check.date(date)
Sets the date of the check
date |
required | The date the check was written. String in yyyy-mm-dd format. |
EFT Data Functions
The Eft functions set properties for a donation made by electronic funds transfer (EFT). This is also called ACH.
All these functions set the payment method to Eft. A donation can only have one payment method. For example, a donation cannot be both credit card and EFT.
EFT is available with the Authorize.Net and BluePay payment processors. We recommend Authorize.Net. If BluePay is used, the account must be set up to allow EFT transactions.
Bloomerang.Eft.type(type)
Sets the type of EFT account (checking or savings).
type |
required | The EFT account type. Valid values are Checking, Savings. |
Bloomerang.Eft.checking()
Sets the EFT account type to Checking. Shortcut for Bloomerang.eft.type(“Checking”).
Bloomerang
Sets the EFT account type to Savings. Shortcut for Bloomerang.Eft.type(“Savings”)
Bloomerang.Eft.accountNumber(number)
Sets the account number that will be charged with the EFT.
number |
required | The account number that will be charged |
Bloomerang.Eft.routingNumber(number)
Sets the bank’s nine-digit routing number.
number |
required | The routing number for the EFT account |
Interaction Data Functions
These functions set data on an interaction
Bloomerang.Interaction.date(date)
Sets the Date on the timeline that the new interaction should have
date |
required | The date of the interaction |
Bloomerang.Interaction.subject(subject)
Sets the Subject for the new interaction.
subject |
required | The subject of the interaction. String, up to 255 characters. |
Bloomerang.Interaction.note(note)
Sets the Note for the new interaction.
note |
optional | The note of the new interactinon. String, up to 64kb. |
Bloomerang.Interaction.channel(channel)
Sets the Channel for the new interaction
channel |
required | The channel of the new interaction. String, valid values: Email, Phone, TextMessage, Mail, InPerson, SocialMedia, Website, Other. |
Bloomerang.interaction.purpose(purpose)
Sets the purpose for the new interaction.
purpose |
required | The purpose of the new interaction. String, valid values: Acknowledgement, ImpactCultivation, Newsletter, Receipt, Solicitation, SpecialEvent, VolunteerActivity, PledgeReminder, Welcome, Other. |
Bloomerang.Interaction.inbound(inbound)
Sets the interaction as inbound (an inbound interaction is one initiated by the constituent)
inbound |
required | Sets the interaction as inbound or not. Boolean. |
Bloomerang.Interaction.customFreeformField(fieldId, value)
Sets a custom field on the interaction. The constituent can type anything into this field.
fieldID |
required | The field’s Bloomerang ID. |
value |
required | Valid formats are string, number, date |
Bloomerang.Interaction.customPickField(fieldId, value1, value2, …)
Sets a custom field on the interaction. The constituent can pick one or more values. This depends on how the field was created in Bloomerang.
This function replaces the field’s values on the JavaScript object.
fieldID |
required | The field’s Bloomerang ID. |
valueID(s) |
required | The values’ Bloomerang IDs. For pick one fields, pass in one valueId. For pick multiple fields, you can pass in multiple valueIds, each as a separate argument. |
Bloomerang.Interaction.clearCustomFields()
Clears all the custom field values for the donation. Call this function to remove any selections left over from a previous submission attempt. Then update the custom fields with values from the form.
This does not delete any custom field values in the Bloomerang database.
Submission Data Functions
The following functions control submitting data to Bloomerang using the API.
Bloomerang.Api.donate()
Posts a one-time donation to Bloomerang. Set up all the data you want to post using the data functions before calling this function. Or set up the data as part of your Bloomerang.Api.OnSubmit handler.
Bloomerang.Api.recurringDonate()
Posts a recurring donation to Bloomerang. Set up all the data you want to post using the data functions before calling this function. Or set up the data as part of your Bloomerang.Api.OnSubmit handler.
Bloomerang.captchaResponse(response)
Google reCAPTCHA sends a Base64-encoded response to the form after client-side validation. Use this function to pass the CAPTCHA response from Google to Bloomerang.
For this function to work, CAPTCHA must be turned on in Bloomerang for the type of form you are using (transaction or interaction).
response |
required | The CAPTCHA response from Google. |
Bloomerang.continueFinancialSubmission(form)
This helper function checks that you are not submitting financial information more than once.
Call this immediately before submitting the form. If it returns true, the form has not been submitted. If it returns false, do not continue the submission. Another submission for the same form is already in progress.
form |
required | The form’s JavaScript DOM element |
Bloomerang.cancelFinancialSubmission(form)
A helper function to clear the restriction set by Bloomerang.continueFinancialSubmission().
Call this when you are finished processing the form. This might be after an error response or if you want the constituent to be able to submit the form again.
form |
required | The form’s JavaScript DOM element |
Bloomerang.Api.submitInteraction()
Posts a new Interaction to Bloomerang. Set up all the data you want to post using the data functions before calling this function. Or set up the data as part of your Bloomerang.Api.OnSubmit handler.