grunion_pre_message_sent

Fires right before the contact form message is sent via email to the recipient specified in the contact form.

Description

do_action( 'grunion_pre_message_sent', (integer) $post_id, (array) $all_values, (array) $extra_values ); 

Parameters (3)

0. $post_id (integer)
Post contact form lives on
1. $all_values (array)
Contact form fields
2. $extra_values (array)
Contact form fields not included in $all_values

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'grunion_pre_message_sent', $post_id, $all_values, $extra_values ); 
The following example is for adding a hook callback.
  1. // define the grunion_pre_message_sent callback 
  2. function action_grunion_pre_message_sent( $post_id, $all_values, $extra_values ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'grunion_pre_message_sent', 'action_grunion_pre_message_sent', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'grunion_pre_message_sent', 'action_grunion_pre_message_sent', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

/modules/contact-form/grunion-contact-form.php  
  1. do_action( 'grunion_pre_message_sent', $post_id, $all_values, $extra_values );