Campaign
This component allows you to interact with the Mailchimp API to manage your email marketing campaigns. It is designed to help you retrieve lists of campaigns, view specific campaign details, and filter data based on various criteria like status, type, and creation time.
Think of this component as a tool to “look up” and organize your existing Mailchimp campaigns. You can use it to find specific campaigns in your automation workflows, check their status, or prepare data for further processing.
How it Works
This component connects directly to the Mailchimp API. When you configure it, you provide your unique Mailchimp API Key (via a credential) to authenticate your account securely.
Once connected, the component performs the following actions:
- Authentication: It uses your stored API credentials to verify your identity with Mailchimp.
- Querying: Based on the inputs you provide (such as filters or specific IDs), it sends a request to Mailchimp to fetch campaign data.
- Data Retrieval: It receives a list of campaigns or details about a specific campaign and passes this information back to your workflow so you can use it in subsequent steps.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type Mailchimp API and fill in the required fields (specifically your API Key). You can find your API Key in your Mailchimp account under Account > API keys.
- In your workflow, select the saved credential in the Credential input field of this node.
Inputs
The following fields are available to configure this component. Each field may be visible in different operations:
- Operation: Select the action you want to perform. This is typically used to define how the component behaves.
- Max Results: The maximum number of results to return. Useful if you only need the most recent campaigns.
- Campaign ID: The ID of the specific campaign to get. If you leave this empty, all campaigns will be returned. If you provide an ID, all other filters will be ignored.
- Aply Filters: A toggle to apply or ignore filters. Turn this on if you want to use the filters below to narrow down your results.
- Filter By: Filter campaigns by a specific parameter. You can select multiple values to filter by multiple parameters.
- Status: Filter campaigns by their current status (e.g., Sent, Draft, Saving).
- Type: Filter campaigns by their type (e.g., Regular, Automated).
- Before Create Time: Restrict the response to campaigns created before a specific date and time.
- After Create Time: Restrict the response to campaigns created after a specific date and time.
- Before Send Time: Restrict the response to campaigns sent before a specific date and time.
- After Send Time: Restrict the response to campaigns sent after a specific date and time.
- Report Type: The type of report data to retrieve for the campaign.
Outputs
Output Data Example (JSON)
This component returns data that you can map to other parts of your workflow. The output typically contains a list of campaign details. json [ { “id”: “5a1b2c3d4e”, “title”: “Summer Sale Newsletter”, “status”: “sent”, “type”: “regular”, “from_name”: “My Company”, “subject”: “Don’t Miss Our Summer Sale!”, “send_time”: “2023-10-01T12:00:00”, “created_at”: “2023-09-25T10:30:00” }, { “id”: “6f7g8h9i0j”, “title”: “Welcome Email”, “status”: “sent”, “type”: “automated”, “from_name”: “My Company”, “subject”: “Welcome to our community”, “send_time”: “2023-09-20T09:00:00”, “created_at”: “2023-09-15T14:20:00” } ]
Connectivity
This component is typically used at the beginning of a workflow branch where you need to access campaign data.
- Connect To: It often connects to Data Transformation, Filter, or Loop components. Once you retrieve a list of campaigns, you might want to filter them further or iterate through them to perform actions on specific campaigns.
- Use Case: Use this component when you need to find a campaign ID to send an update, or when you need to review past campaign performance data for reporting.
Usage Example
Scenario: Finding Recent Sent Campaigns
- Add the Campaign component to your workflow.
- Select your Mailchimp API credential.
- Set Aply Filters to True.
- In Status, select Sent.
- In After Send Time, enter a date like
2023-09-01to only get campaigns sent after September 1st. - Run the workflow. The component will return a list of all campaigns that were sent after the specified date, which you can then use to analyze performance or notify stakeholders.
Tips and Best Practices
- Use IDs for Precision: If you know the specific ID of a campaign you need, enter it in the Campaign ID field. This is faster and more accurate than trying to filter by name or time.
- Limit Your Results: Use Max Results to avoid slowing down your workflow. If you only need the last 5 campaigns, set this number to 5.
- Check Statuses: Understanding the Status filter (e.g., Draft vs. Sent) is crucial. If you are looking for campaigns that have already been emailed to your list, ensure you filter by “Sent”.
- Date Formats: When using Before/After Send Time or Create Time, ensure you use the correct date and time format (usually ISO 8601) as expected by the Mailchimp API.
Security Considerations
- API Key Safety: Never share your Mailchimp API Key publicly. Always store it in Nappai’s secure Credentials section rather than hardcoding it in your workflow.
- Access Control: Ensure that your Mailchimp account has the appropriate permissions to view campaigns. If the component returns an error, check that your API Key has the necessary read/write scopes.