Last active
February 24, 2017 01:29
-
-
Save nciske/9f7320ee1da189a0313b to your computer and use it in GitHub Desktop.
salesforce_w2l_cc_admin_from_email example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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