WPIntell

Source evidence

Filter by campaign

Campaign Archive Block for Mailchimp · support · 2022-05-29T14:21:00+00:00

mixedsentiment
mediumseverity
0.78relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

8 / 33 rows with source links

24.2% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

25 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Matt Radford resolved
Hi. Thanks for this nice plugin. Could you suggest filtering per-campaign? At the moment the block outputs all newsletters for the Mailchimp account, but I need to filter these to one campaign only. I can see you’ve added a filter at the end of \CABFM\Blocks::render_block(), but in $campaigns I can’t see a way to uniquely identify particular campaigns. Perhaps I’m misunderstanding how Mailchimp campaigns work. Thanks for any advice you have. Hi Matt, thanks for reaching out. I was also confused in the beginning on how this works with Mailchimp. In their terminology, a “campaign” if a single sent “newsletter email”. Those can be grouped in “campaign folder”. In the single campaign you will find a “folder_id” which you could use to filter the campaigns. I’ve added a filter to make this possible, but I just realized that I used the wrong name there. Before you use it, please give me some time tomorrow to fix the name. Filtering campaigns by folder and by date is something I wanted to add to a future version of the plugin, but for the first release this was a bit too complex. For your use-case, would it help you to have a filter to alter the campaign before they go into the foreach loop? Hi Matt, I’ve just released a new version. You can now use the filter cabfm_campaigns_query_args to add arguments to the Mailchimp API call and cabfm_campaigns_markup to modify the rendered markup. You could use the “folder_id” field to filter for the “campaign folder”: https://mailchimp.com/developer/marketing/api/campaigns/list-campaigns/ Thank you for being so willing to make some changes Bernhard 🙂 I haven’t had a chance to test this out yet, but will do later this week and will report back. Hi Bernhard I’ve tested this now and it works with the filter, many thanks! One thing though: Mailchimp don’t make it wasy to get the folder ID. There is an “f_folder” in the URL when you navigate to the folder, but that’s not it. I had to make a GET request to the /campaign-folders endpoint to list them all, and the response shows that the folder_id needed is in the format “ab7abba2f8”. Once I’d added a filter to add that to the $query_args, it worked as expected. So one enhancement, should you be inclined, would be to make that campaign-folders request in the Settings and offer a list of Campaign folders to display. Thanks again 🙂 Matt Hi Matt, that’s exactly the feature I’m currently working at. I already finished the part getting the folder names and IDs from the Mailchimp API. Now I “only” have to implement the block setting with a dropdown to select those folders. But this is still the hard part for me as I still haven’t completely learned how to load dynamic data into blocks/React. I have the custom REST endpoint bug still need some lines of JS code to make them work 🙂

Comments

5 shown
Bernhard Kau 2022-05-29T18:14:00+00:00

Hi Matt, thanks for reaching out. I was also confused in the beginning on how this works with Mailchimp. In their terminology, a “campaign” if a single sent “newsletter email”. Those can be grouped in “campaign folder”. In the single campaign you will find a “folder_id” which you could use to filter the campaigns. I’ve added a filter to make this possible, but I just realized that I used the wrong name there. Before you use it, please give me some time tomorrow to fix the name. Filtering campaigns by folder and by date is something I wanted to add to a future version of the plugin, but for the first release this was a bit too complex. For your use-case, would it help you to have a filter to alter the campaign before they go into the foreach loop?

Bernhard Kau 2022-05-30T07:19:00+00:00

Hi Matt, I’ve just released a new version. You can now use the filter cabfm_campaigns_query_args to add arguments to the Mailchimp API call and cabfm_campaigns_markup to modify the rendered markup. You could use the “folder_id” field to filter for the “campaign folder”: https://mailchimp.com/developer/marketing/api/campaigns/list-campaigns/

Matt Radford 2022-06-05T22:50:00+00:00

Thank you for being so willing to make some changes Bernhard 🙂 I haven’t had a chance to test this out yet, but will do later this week and will report back.

Matt Radford 2022-06-21T21:09:00+00:00

Hi Bernhard I’ve tested this now and it works with the filter, many thanks! One thing though: Mailchimp don’t make it wasy to get the folder ID. There is an “f_folder” in the URL when you navigate to the folder, but that’s not it. I had to make a GET request to the /campaign-folders endpoint to list them all, and the response shows that the folder_id needed is in the format “ab7abba2f8”. Once I’d added a filter to add that to the $query_args, it worked as expected. So one enhancement, should you be inclined, would be to make that campaign-folders request in the Settings and offer a list of Campaign folders to display. Thanks again 🙂 Matt

Bernhard Kau 2022-06-21T21:34:00+00:00

Hi Matt, that’s exactly the feature I’m currently working at. I already finished the part getting the folder names and IDs from the Mailchimp API. Now I “only” have to implement the block setting with a dropdown to select those folders. But this is still the hard part for me as I still haven’t completely learned how to load dynamic data into blocks/React. I have the custom REST endpoint bug still need some lines of JS code to make them work 🙂