# Which Event to use instead of CampaignExecutionEvent in Mautic 3 plugins?

**URL:** <https://forum.mautic.org/t/which-event-to-use-instead-of-campaignexecutionevent-in-mautic-3-plugins/18614>\
**Category:** Development\
**Tags:** development, mautic-3\
**Created:** [March 17, 2021, 10:37am UTC](https://forum.mautic.org/t/which-event-to-use-instead-of-campaignexecutionevent-in-mautic-3-plugins/18614 "2021-03-17T10:37:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayanktiwaridotcom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mayanktiwaridotcom/32/1501_2.png) [@mayanktiwaridotcom](https://forum.mautic.org/u/mayanktiwaridotcom)\
**Post date:** [March 17, 2021, 10:37am UTC](https://forum.mautic.org/t/which-event-to-use-instead-of-campaignexecutionevent-in-mautic-3-plugins/18614/1 "2021-03-17T10:37:17Z")

</div>

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

I am working on a custom plugin where I need to create some custom campaign actions, I was checking upgrade document and see that campaign Execution Event is removed, however what should be used instead is not to be found.

I checked core bundle to find out what `CampaignSubscribers` are using and I still see Campaign Execution event being used, Now I am confused shall I use it or not.

Even though upgrade document says it was removed, it is still being used in Core classes of Mautic.

---

<div class="post-metadata">

**Author:** ![alanhartless1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alanhartless1/32/798_2.png) [@alanhartless1](https://forum.mautic.org/u/alanhartless1)\
**Post date:** [April 20, 2021, 10:53pm UTC](https://forum.mautic.org/t/which-event-to-use-instead-of-campaignexecutionevent-in-mautic-3-plugins/18614/2 "2021-04-20T22:53:23Z")

</div>

Hi @mayanktiwaridotcom,

This is a good question and unfortunately the docs are outdated. Campaigns were refactored sometime back to support processing batches of contacts for campaign actions rather than one at a time.

The new events are:  
CampaignDecisionEvent → \Mautic\CampaignBundle\Event\DecisionEvent  
CampaignExecutionEvent → \Mautic\CampaignBundle\Event\PendingEvent  
CampaignScheduledEvent → \Mautic\CampaignBundle\Event\ScheduledEvent

The subscriber to \Mautic\CampaignBundle\CampaignEvents::CAMPAIGN\_ON\_BUILD needs to define a batch event via the action metadata’s “batchEventName” (“callback” and “eventName” are deprecated).

Searching PendingEvent will give you some examples [Search · PendingEvent · GitHub](https://github.com/mautic/mautic/search?q=PendingEvent&type=code). For example, [mautic/CampaignSubscriber.php at 7a2875bc16a6de50a1803fbc41b64278ae9b5428 · mautic/mautic · GitHub](https://github.com/mautic/mautic/blob/7a2875bc16a6de50a1803fbc41b64278ae9b5428/app/bundles/EmailBundle/EventListener/CampaignSubscriber.php#L253).

Hope that helps!
