Event / Observer Hooks
Our Magento® Custom Contact Forms extension comes with numerous event hooks, making it easy for developers to extend the functionality of this extension and of specific forms.
You’ll find a detailed list of the available event / observer hooks below.
Contact Form Submit Before
Description
Client side form submit before processing hook.
To stop further processing and show an error message, set the ‘stop_processing’ property of the ‘params’ object to true:
$observer->getEvent()->getParams()->setStopProcessing(true);
Event Details
Event Code | pc_contactforms_form_submit_before | ||||||
Event Parameters |
|
Contact Form Submit After
Description
Client side form submit after processing.
Event Details
Event Code | pc_contactforms_form_submit_after | ||||||
Event Parameters |
|
Customer Notification Send Before
Description
Customer notification e-mail send before hook. E-mail parameters can be modified here if needed.
To prevent the e-mail from being sent, set the ‘can_send_mail’ property of the ‘mail_data’ object to ‘false’:
$observer->getEvent()->getMailData()->setCanSendMail(false);
Event Details
Event Code | pc_contactforms_customer_notify_before | ||||||
Event Parameters |
|
Customer Notification Send After
Description
Customer notification e-mail send after hook.
Event Details
Event Code | pc_contactforms_customer_notify_after | ||||||
Event Parameters |
|
Admin Notification Send Before
Description
Admin notification e-mail send before hook. E-mail parameters can be modified here if needed.
To prevent the e-mail from being sent, set the ‘can_send_mail’ property of the ‘mail_data’ object to ‘false’:
$observer->getEvent()->getMailData()->setCanSendMail(false);
Event Details
Event Code | pc_contactforms_admin_notify_before | ||||||
Event Parameters |
|
Admin Notification Send After
Description
Admin notification e-mail send after hook.
Event Details
Event Code | pc_contactforms_admin_notify_after | ||||||
Event Parameters |
|
Form Save Before Event
Description
Custom Contact Form save before event. Takes place before saving a form in the admin area.
Event Details
Event Code | plugincompany_contactforms_form_save_before | ||||
Event Parameters |
|
Form Save After Event
Description
Custom Contact Form save after event. Takes place after saving a form in the admin area.
Event Details
Event Code | plugincompany_contactforms_form_save_after | ||||
Event Parameters |
|
Form Submission Save Before Event
Description
Form submission save before event. Takes place before saving a form submission in the database.
Event Details
Event Code | plugincompany_contactforms_entry | ||||
Event Parameters |
|
Form Submission Save After Event
Description
Form submission save after event. Takes place after saving a form submission in the database.
Event Details
Event Code | plugincompany_contactforms_entry | ||||
Event Parameters |
|