The Recipient Master (RecipientMaster) Data Block in Assette is responsible for retrieving and constructing recipient-level data required for personalized content delivery and distribution workflows. This includes contact metadata, address information, delivery preferences, and recipient-account associations. The block supports integration with either Assette’s Recipient Upload or a third-party CRM system (e.g., Salesforce, Microsoft Dynamics) through configurable dependencies.
General Info #
| Field | Value |
|---|---|
| Name | RecipientMaster |
| Block Category | Interface |
| Block Type | Python |
| Output Type | Data Table |
| Editable | True |
Dependencies #
Depending on the desired data source (see Switching Between Data Sources), dependencies must be added or removed.
| Data Block Name | Description |
|---|---|
| CalculationEnv | Defines the imported Python modules and libraries (e.g., “import numpy as np”) [Link] |
| GetRecipientInfoSalesforce | Retrieves contact information from the Salesforce CRM system, leveraging Salesforce Object Query Language [Link] |
| GetRecipientInfoSalesforceTransform | |
| GetRecipientInfoLocal | Used to accessing recipient metadata from Assette’s internal data service. [Link] |
| GetRecipientsLocalDB | Retrieves active recipient records from the Assette’s internal database. It provides details about delivery preferences, contact information, and localization settings for each recipient. [Link] |
Switching Between Data Sources #
The block supports two data source configurations:
- Local Database (Assette-hosted)
- Third-party CRM (e.g., Salesforce)
To switch between data sources, comment/uncomment the appropriate code snippet:
Local Database #
RecipientInfo_meta_data = pd.DataFrame(read("GetRecipientInfoLocal", params)["data"])
recipientsList = pd.DataFrame(read("GetRecipientsLocalDB",{})["data"])
CRM Integration (Salesforce Example): #
RecipientInfo_meta_data = pd.DataFrame(read("GetRecipientInfo", params)["data"])
recipientsList = pd.DataFrame(read("GetRecipient", params)["data"])
Note: The block is designed to work with any CRM system—not just Salesforce—provided the dependent blocks return data in the expected structure.
Parameter Handling #
Parameters passed to the block are used to filter and refine the recipient list. Supported parameters include:
| Parameter Name | Description |
|---|---|
FirstName, LastName | Filters recipients by name |
Email | Filters based on recipient email |
Address1, Address2, City, State, Country, Zip | Filters by address fields |
Company | Filters recipients by associated company |
Code | Filters recipients by unique code |
ID (as Param_ID) | Filters by record ID |
AccountCode, OrganizationCode | Used for CRM-specific lookups |
Person and Address Construction #
Each recipient is mapped to a nested Person dictionary, which includes personal details and a PersonAddresses list. The build_person_new() function handles this transformation, ensuring consistent formatting for downstream consumption.
Sample structure: #
{
"RecipientCode": "...",
"Person": {
"FirstName": "...",
"LastName": "...",
"PersonAddresses": [{
"Address1": "...",
"City": "...",
"State": "...",
"Country": "..."
}]
}
}
Default and Missing Field Handling #
The block ensures structural consistency by injecting default values for any missing columns in the input dataset. Fields such as IsEmailDeliveryEnabled, Language, EmailTO, and others are initialized if not present in the source data.
Filtering Logic #
The output is further filtered using parameter-driven logic, including support for:
- Email match
- Name and address matching
- Company and recipient code filters
- Record ID matching
If specific filters are applied (e.g., Email, FirstName, or Code), only matching records will be included in the final output.
Example Request #
{}
Example Response #
{
"ID": 101,
"PersonID": 101,
"IsEmailDeliveryEnabled": true,
"EmailTO": "client@example.com",
"FirstName": "John",
"LastName": "Doe",
"Address1": "123 Market Street",
"City": "Boston",
"State": "MA",
"Country": "USA",
"Zip": "02108",
"Person": {
"FirstName": "John",
"LastName": "Doe",
"PersonAddresses": [{
"Address1": "123 Market Street",
"City": "Boston",
"State": "MA",
"Country": "USA"
}]
}
}