Browse Source

Hook up new email to contact form.

pull/117/head
Ned Zimmerman 7 years ago
parent
commit
03df1ac78c
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 3
      inc/helpers/namespace.php

3
inc/helpers/namespace.php

@ -244,6 +244,7 @@ function handle_contact_form_submission() {
return false; // Security check failed. return false; // Security check failed.
} }
if ( isset( $_POST['submitted'] ) ) { if ( isset( $_POST['submitted'] ) ) {
$contact_email = get_option( 'pb_network_contact_email', get_option( 'admin_email' ) );
$output = []; $output = [];
$name = ( isset( $_POST['visitor_name'] ) ) ? $_POST['visitor_name'] : ''; $name = ( isset( $_POST['visitor_name'] ) ) ? $_POST['visitor_name'] : '';
$email = ( isset( $_POST['visitor_email'] ) ) ? $_POST['visitor_email'] : ''; $email = ( isset( $_POST['visitor_email'] ) ) ? $_POST['visitor_email'] : '';
@ -277,7 +278,7 @@ function handle_contact_form_submission() {
$output['field'] = 'message'; $output['field'] = 'message';
} else { } else {
$sent = wp_mail( $sent = wp_mail(
get_option( 'admin_email' ), $contact_email,
sprintf( __( 'Contact Form Submission from %s', 'pressbooks-aldine' ), $name ), sprintf( __( 'Contact Form Submission from %s', 'pressbooks-aldine' ), $name ),
sprintf( sprintf(
"From: %1\$s <%2\$s>\nInstitution: %3\$s\n\n%4\$s", "From: %1\$s <%2\$s>\nInstitution: %3\$s\n\n%4\$s",

Loading…
Cancel
Save