This hook allows you to add or change headers for the email notifications.
Usage
add_filter('frm_email_header', 'custom_header', 10, 2); function custom_header($header, $atts)
Parameters
- $header (array in current version, but is string in older versions)
- $atts (array)
- $atts['to_email']
- $atts['subject']
Examples
Add BCC
add_filter('frm_email_header', 'add_frm_bcc', 10, 2); function add_frm_bcc($header, $atts){ if(is_array($header)) $header[] = "BCC: hidden@email.com"; else $header .= "BCC: hidden@email.com"; return $header; }
Dynamically Change Reply-To Email
Use this code to change the Reply-To email address based on an email field in your form.
add_filter('frm_email_header', 'dynamic_reply_to', 10, 2); function dynamic_reply_to($header, $atts){ if (isset($_POST['item_meta'][6359])){//Change 6359 to the ID of the email field in your form $header[] = "Reply-To: one@test.com, two@test.com,". $_POST['item_meta'][6359];//Change 6359 to the ID of the email field in your form } return $header; }