Skip to content

Commit

Permalink
conditional freeform event handler if installed
Browse files Browse the repository at this point in the history
  • Loading branch information
simon.rabjohns committed Oct 31, 2019
1 parent d2bb094 commit 90f6757
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Drip.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,14 @@ function (Event $event) {
* http://docs.solspace.com/craft/freeform/v2/developer/events-and-hooks.html#submissions
*/

Event::on(
FormsService::class,
FormsService::EVENT_AFTER_SUBMIT,
function (AfterSubmitEvent $event) {
Drip::$plugin->dripService->addFormSubmission($event);
}
);
if (Craft::$app->plugins->isPluginInstalled('freeform')) {
Event::on(
FormsService::class,
FormsService::EVENT_AFTER_SUBMIT,
function (AfterSubmitEvent $event) {
Drip::$plugin->dripService->addFormSubmission($event);
}
);
}
}
}

0 comments on commit 90f6757

Please sign in to comment.