Skip to content

Instantly share code, notes, and snippets.

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 strangerstudios/23e025a3dc334ff791af to your computer and use it in GitHub Desktop.
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.
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