Add mailpoet_subscription_before_subscribe hook
In order for 3rd parties to hook into the subscription process, e.g. to validate the data themselves, the action hook mailpoet_subscription_before_subscribe has been added. [MAILPOET-3632]
This commit is contained in:
@@ -119,6 +119,17 @@ class SubscriberSubscribeController {
|
|||||||
return $meta;
|
return $meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fires before a subscription gets created.
|
||||||
|
* To interrupt the subscription process, you can throw an MailPoet\Exception.
|
||||||
|
* The error message will then be displayed to the user.
|
||||||
|
*
|
||||||
|
* @param array $data The subscription data.
|
||||||
|
* @param array $segmentIds The segment IDs the user gets subscribed to.
|
||||||
|
* @param FormEntity $form The form the user used to subscribe.
|
||||||
|
*/
|
||||||
|
$this->wp->doAction('mailpoet_subscription_before_subscribe', $data, $segmentIds, $form);
|
||||||
|
|
||||||
$subscriber = $this->subscriberActions->subscribe($data, $segmentIds);
|
$subscriber = $this->subscriberActions->subscribe($data, $segmentIds);
|
||||||
|
|
||||||
if (!empty($captchaSettings['type']) && $captchaSettings['type'] === Captcha::TYPE_BUILTIN) {
|
if (!empty($captchaSettings['type']) && $captchaSettings['type'] === Captcha::TYPE_BUILTIN) {
|
||||||
|
Reference in New Issue
Block a user