This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
—This hook is deprecated as of version 2.04—
Use frm_display_[field type]_value_custom hook instead
Change or format a value in the email notification before sending. This allows you to modify specific values in the email notification without modifying the entire email message.
Usage
add_filter('frm_email_value', 'frm_email_val', 15, 3); function frm_email_val($value, $meta, $entry)
Parameters
- $value (string or array)
- $meta (object)
- $entry (object)
Examples
Change a value in an email
Use this code to format a field value or change the field value that displays in the email notification.
add_filter('frm_email_value', 'frm_email_val', 15, 3);
function frm_email_val($value, $meta, $entry){
if($meta->field_id == 25){ //change 25 to the ID of your field
$value = "My custom email content"; //change the value here
}
return $value;
}
Replace ampersand character reference
Use the code below to replace an ampersand character reference with a plain ampersand. Replace 25 with the ID of the field you want to modify.
add_filter( 'frm_email_value', 'frm_replace_ampersand', 15, 3);
function frm_replace_ampersand( $value, $meta, $entry ){
if ( $meta->field_id == 25 ) { //change 25 to the ID of your field
$value = str_replace("&","&",$value);
}
return $value;
}
Deprecated in version 2.04