Trigger mautic:segments:update when user adds a tag manually via UI

Hi! I hope you’re well!

My company just decided to use Mautic, and I’ve been assigned to implement it.

(am just in the process of familiarizing with the docs & codebase - so forgive me if any questions seem obviously answered anywhere)

A question from our marketing team was, is there a way to have a segment updated immediately after they manually add a tag or segement to a contact, as opposed to waiting for cronjobs to run.

i can see a few potential options - like calling a bash script (containing the mautic:segments:update call) when save method is called… but before i dig any further i thought i’d check if a solution already exists / there is a recommended way to achieve this.

Many thanks & look forward to testing!

ended up just running update:segment more often but using tsp (Ubuntu Manpage: ts - task spooler. A simple unix batch system) for all cronjobs so they’re always sequential.

for example, if need to run update segment every 5 min:

/5 * * * tsp -n php /var/www/html/mautic/bin/console mautic:segments:update --no-interaction --no-ansi

using tsp has added benefit of no longer have to stagger cronjobs to avoid concurrency.

working nicely so far

Iteration for the same topic.
The one minute version.