# Segment and campaign not trigger plus twilio plugin doesn't send message to contact number

**URL:** https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789
**Category:** Product Support
**Created:** [August 1, 2023, 11:02am UTC](https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789 "2023-08-01T11:02:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![shekhar](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@shekhar](https://forum.mautic.org/u/shekhar)
#### Post date: [August 1, 2023, 11:02am UTC](https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789/1 "2023-08-01T11:02:13Z")

</div>

**Your software**  
My Mautic version is: 4.4.9  
My PHP version is: 7.4 (ea-php74)  
My Database type and version is: 5.7.23- |Doctrine driver|pdo\_mysql|  
|Doctrine database platform (automatically detected)|Doctrine\DBAL\Platforms\MySQL57Platform|

**Your problem**  
My problem is:  
Hi, We have installed mautic on a new server and configure the Twilio plugin there using account sid and token with Twilio number to send message from. After this we have created a segment and added a filter there to trigger the segment and further I have make a campaign where I added that segment so after all of this I have created a contact and fill up that text field which I used to triger the segment like saying “city contain “Florida””. But nothing is working. It never trigger the segment neither campaign and Twilio message not send to that contact number. Any help regarding this would be much appreciated. Thank you!!  
These errors are showing in the log:  
No error

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [August 1, 2023, 12:49pm UTC](https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789/2 "2023-08-01T12:49:34Z")

</div>

Have you run any of the cron jobs that are necessary for the whole thing to work?

Here is the information:

> **[Cron jobs](https://docs.mautic.org/en/setup/cron-jobs)**
>
> . . . . Mautic 3 introduced a new path for cron jobs bin/console if you are using the legacy Mautic 2.x series you should replace this with the older version, app/console. . . . Mautic requires a few cron jobs to handle some maintenance tasks such as...

You will need to:

1. Rebuild segments
2. Rebuild campaigns
3. Trigger campaigns
4. Send Scheduled Broadcast

Check the output of the cron jobs when they run, and check the segment / campaign to see the actions. Also check the contacts who should receive the messages and see if there are any errors in the activity feed.

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [August 1, 2023, 12:54pm UTC](https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789/3 "2023-08-01T12:54:54Z")

</div>

There was a change on the Twilio side. See [Support to Pass MessagingServiceSID to Twillio API instead of From by dadarya0 · Pull Request #12539 · mautic/mautic · GitHub](https://github.com/mautic/mautic/pull/12539) which is for Mautic 5 only at the moment

---

<div class="post-metadata">

### Author: ![shekhar](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@shekhar](https://forum.mautic.org/u/shekhar)
#### Post date: [August 2, 2023, 5:33am UTC](https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789/4 "2023-08-02T05:33:22Z")

</div>

Hi @silavapi @escopecz ,  
Thanks for the reply of my forum. Here is my mautic installation path directory and I have added the cron jobs now But still getting the same issue of message not sending. It seems like segment is triggered now. I have attached the screenshots of things I done Please check and let me know what changed I need to do further so I will do accordingly. Thanks

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f10f50de9ad5a97ef85510ea255d71dd14c97196.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cf970e22a92e6da41fb92a9c637a17ec0fd24bfd.png)  
In segment name “Test” I am using this filter  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/354e4a57bcfca16549b5d205e3de357775150bcf.png)

After create a contact I got this error in contact events

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/896268686c3cb19e5fb526e435fdf75d3222e4a9.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9803c5f09ca4a257c70c987fca14ac9cb1f9c6f0.png)

And here is the error logs of system inormation  
[2023-08-02 00:30:05] mautic.NOTICE: Symfony\Component\Console\Exception\CommandNotFoundException: Command “mautic:queue:cleanup” is not defined. Did you mean one of these? fos:oauth-server:clean mautic:maintenance:cleanup mautic:queue:process (uncaught exception) at /home4/topscbtk/tango.topscripts.in/vendor/symfony/console/Application.php line 676 while running console command `UNKNOWN` {“hostname”:“cs2001.hostgator.in”,“pid”:291564}

Please have a look in this matter and let me know how to sort out this please. Thanks again.

---

<div class="post-metadata">

### Author: ![shekhar](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@shekhar](https://forum.mautic.org/u/shekhar)
#### Post date: [August 2, 2023, 6:06am UTC](https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789/5 "2023-08-02T06:06:13Z")

</div>

Hi @escopecz ,  
Thanks for the reply.  
Here is my current configuration for twilio plugin in Mautic version 4.4.9

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/dd6bcb4561254c6d695c75b54fbf9a2fa1f5c639.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/88796bd5936702ae61ce3598ae930b742dc30df5.png)  
Please have a look and let me know how do sort out this. Thanks

---

<div class="post-metadata">

### Author: ![shekhar](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@shekhar](https://forum.mautic.org/u/shekhar)
#### Post date: [August 3, 2023, 4:34am UTC](https://forum.mautic.org/t/segment-and-campaign-not-trigger-plus-twilio-plugin-doesnt-send-message-to-contact-number/28789/6 "2023-08-03T04:34:27Z")

</div>

@silavapi I also received this error now  
[2023-08-03 04:22:03] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘INSERT INTO campaign\_lead\_event\_log (rotation, date\_triggered, is\_scheduled, trigger\_date, system\_triggered, metadata, channel, channel\_id, non\_action\_path\_taken, event\_id, lead\_id, campaign\_id, ip\_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [2, “2023-08-03 04:22:02”, 1, “2023-08-03 04:27:02”, 1, “a:0:{}”, null, null, 0, 481, “121”, 11, null]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘481-121-2’ for key ‘campaign\_rotation’ {“hostname”:“vultr”,“pid”:3916}
