Created
June 27, 2014 23:59
-
-
Save strangerstudios/23e025a3dc334ff791af to your computer and use it in GitHub Desktop.
Ninja Forms use email from form for email_from and email_from_name.
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_action( 'ninja_forms_email_admin', 'ninja_forms_change_from_address' ); | |
function ninja_forms_change_from_address(){ | |
global $ninja_forms_processing; | |
if( 1 == $ninja_forms_processing->get_form_ID() ) { | |
$user_email = $ninja_forms_processing->get_field_value( 2 ); | |
$user_name = $ninja_forms_processing->get_field_value( 1 ); | |
$ninja_forms_processing->update_form_setting( 'email_from', $user_email ); | |
$ninja_forms_processing->update_form_setting( 'email_from_name', $user_name ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment