My Mautic version is: 3.3.3
My PHP version is: 7.4.9
My Database type and version is: MySQL, mysqlnd 7.4.9
When Contact removed from Campaign by Campaign action, after ‘Rebuild campaigns’ cron job triggered contact returned to campaign.
Assume we have one of the action in the campaign, which remove contact from the this campaign:
After action is triggered, contact removed from campaign successfully. From contact events log:
But, after sometime, contact returned back to the campaign. No one make this manually:
This event time suspiciously matches with time when ‘mautic:campaigns:rebuild’ cron job starts.
Code investigation shows that all leads which has ‘manualy_removed = 0’ flag value will be added back to campaign. At the same time, “Remove action” just set Manually removed flag to true, so all looks fine, maybe bug somewhere deeper.
Please, confirm bug or provide us with right solution of this problem.
I have a theory, plz check it:
- The source of your campaign is a Segment
- Contacts are added because they are a member of a segment
- You set the campaign so, that contacs can re-enter the campaign
- Once you move them out by a campaign action, they are still member of the segment, so requalify and return into the campaign.
Either change segment membership or prohibit reendering the campaign.
Your theory proved to be correct, we had enabled the ‘re-entering the campaign’ option for testing purposes and that was causing the misbehaviour.
Thank you for your answer, it has been incredibly useful.
I am facing the issue that I created the campaign to send automation emails to the segment. But the campaign showing zero contacts.
Please help me.
Screenshot by Lightshot (Campaign Flows)
Screenshot by Lightshot (segment)
My suggestion is to check cron jobs (Cron jobs | Mautic):
→ mautic:campaigns:rebuild (alias mautic:campaigns:update) is responsible for the association of contacts to campaigns.