Mautic Community Forums

What do campaigns:rebuild & segments:update do exactly?

I’m asking that so that I can make a more educated choice on how often to execute the cron jobs for these 2 jobs



I already know that campaigns:trigger is responsible for executing campaign actions and sending out corresponding emails, so I have set that to 1 minute.



But I currently have not a good idea about what those 2 others job do exactly,. In the docs it only describes those jobs in a very general way, with no examples of what they exactly do in practice.



Can anyone give some examples of what campaigns:rebuild & segments:update do exactly, in practice?

I’m asking that so that I can make a more educated choice on how often to execute the cron jobs for these 2 jobs

I already know that campaigns:trigger is responsible for executing campaign actions and sending out corresponding emails, so I have set that to 1 minute.

But I currently have not a good idea about what those 2 others job do exactly,. In the docs it only describes those jobs in a very general way, with no examples of what they exactly do in practice.

Can anyone give some examples of what campaigns:rebuild & segments:update do exactly, in practice?

It’s taken me about 2 weeks to get to grips with Mautic. The documentation really needs beefing up, but it all takes time for the guys at Mautic.

I’m pretty sure campaigns:trigger doesn’t need to be set to 1 minute. If emails are set to be sent immediately in your campaign builder, they will send straight away. You don’t need a cron job to make that happen as the action will happen anyway. Cron jobs (i.e. chronological jobs) are just jobs that need to be executed periodically. This cron job will ensure things like that are timed, will be sent (e.g. an email will be sent one week after the previous email was read).

EDITED: Ok, so I’m obviously still learning! I’ve just tried to send out an email shot, and changed the email configuration to ‘queue’ so I could send them in batches. It seems that this setting overrides the ‘send immediately’ setting in the Campaign Builder, causing emails in the campaign to be queued.

By the way, some hosting companies don’t like cron jobs to be run frequently, so a 1 minute setting might breach terms and conditions. My host says to run a single cron job no more than once every 30 minutes.

mautic:segments:update - I’ll give you an example of how I used this. I created segments for different countries/regions (e.g. United Kingdom). After creating the segment, there were no contacts in the segment. I basically had to wait until the mautic:segments:update cron job ran before the segment was populated with contacts from the UK.

mautic:campaigns:rebuild - no idea! I don’t understand MxyzptlkFishStix’s post either - how can campaigns be updated with contacts?

As for timings, as I said before, check with your hosting company. I think it also depends on how many subscribers you are getting. With my numbers and campaigns right now, I could probably set it once a day.

“I’m pretty sure campaigns:trigger doesn’t need to be set to 1 minute. If emails are set to be sent immediately in your campaign builder, they will send straight away.”

Are you sure about that? If my memory serves me right, no campaign emails were being sent at all until I set up this cron job.

My host is ok with cronning every 1 minute for that job. I explained why I needed it and they set it up for me like that.

“mautic:segments:update - I’ll give you an example of how I used this…”

You’re right. The way you explained this, I also learned and experienced this myself yesterday, as I was figuring out what segment filters actually do.

About:

charlescorn: “mautic:campaigns:rebuild - no idea! I don’t understand MxyzptlkFishStix’s post either - how can campaigns be updated with contacts?”

MxyzptlkFishStix: “mautic:campaigns:rebuild - keeps individual campaigns updated with fresh contacts via the forms/segments you’ve setup to populate them”

Maybe it means that after a contact is filtered to a segment, mautic:campaigns:rebuild will add that contact to any corresponding campaign that you’ve set up for that segment.

[quote=19590:@Paul999]“I’m pretty sure campaigns:trigger doesn’t need to be set to 1 minute. If emails are set to be sent immediately in your campaign builder, they will send straight away.”

Are you sure about that? [/quote]

No, not any more! I was sure, then I tried something new, and got in a mess. This seems to be typical of my Mautic journey. I edited my post above when I discovered this. Seems that the email config setting (queue or send immediately) overrides settings in the Campaign Builder.

Re. mautic:campaigns:rebuild - so this cron job pushes fresh contacts into a campaign?

What about if you change a campaign? e.g. I’ve just created a new campaign action, which sends an email to contacts who open a previous email in a campaign. How do these changes in a campaign get updated? Is this mautic:campaigns:trigger?

I’m not sure, but my guess is that campaigns:trigger excecutes anything that happens inside the campaigns / the campaign builder components, and that campaigns:rebuild just adds segmented contacts to the campaigs.

But probably there’s a bit more going on than just that.

@MxyzptlkFishStix Would be great if you could elaborate in more detail, if you have insight into the inner workings of this.