HomeMagento® Custom Contact FormsTutorialsEvent / Observer Hooks

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 Codepc_contactforms_form_submit_before
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form
paramsVarien_Object

 

 

Contact Form Submit After

Description

Client side form submit after processing.

 

Event Details

Event Codepc_contactforms_form_submit_after
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form
paramsVarien_Object

 

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 Codepc_contactforms_customer_notify_before
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form
mail_dataVarien_Object

 

Customer Notification Send After

Description

Customer notification e-mail send after hook.

 

Event Details

Event Codepc_contactforms_customer_notify_after
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form
mail_dataVarien_Object

 

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 Codepc_contactforms_admin_notify_before
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form
mail_dataVarien_Object

  

Admin Notification Send After

Description

Admin notification e-mail send after hook.

 

Event Details

Event Codepc_contactforms_admin_notify_after
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form
mail_dataVarien_Object

 

Form Save Before Event

 

Description

Custom Contact Form save before event. Takes place before saving a form in the admin area.

 

Event Details

Event Codeplugincompany_contactforms_form_save_before
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form

 

Form Save After Event

 

Description

Custom Contact Form save after event. Takes place after saving a form in the admin area.

 

Event Details

Event Codeplugincompany_contactforms_form_save_after
Event Parameters
KeyObject type
formPlugincompany_Contactforms_Model_Form

 

Form Submission Save Before Event

 

Description

Form submission save before event. Takes place before saving a form submission in the database.

 

Event Details

Event Codeplugincompany_contactforms_entry
Event Parameters
KeyObject type
entryPlugincompany_Contactforms_Model_Entry

 

Form Submission Save After Event

Description

Form submission save after event. Takes place after saving a form submission in the database.

 

Event Details

Event Codeplugincompany_contactforms_entry
Event Parameters
KeyObject type
entryPlugincompany_Contactforms_Model_Entry

Was this article helpful to you? Yes 5 No