Skip to content

Instantly share code, notes, and snippets.

@nciske
Last active February 24, 2017 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nciske/9f7320ee1da189a0313b to your computer and use it in GitHub Desktop.
Save nciske/9f7320ee1da189a0313b to your computer and use it in GitHub Desktop.
salesforce_w2l_cc_admin_from_email example
add_filter('salesforce_w2l_cc_admin_replyto_email','yourprefix_salesforce_w2l_cc_admin_from_email');
function yourprefix_salesforce_w2l_cc_admin_replyto_email( $email ){
// change to the field name you want to use if not using the built in field
$field_name = 'email';
// Get the email from the POST data, and sanitize it
$user_email = sanitize_email( $_POST[ $field_name ] );
// if it's a theoretically email address, use it
if( is_email( $user_email ) )
return $user_email;
// otherwise use the value passed in
return $email;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment