Last active
September 1, 2019 15:06
-
-
Save macariojames/0dc33cdd3fb5e9e833cee6f8f99b5c1c to your computer and use it in GitHub Desktop.
ACF Advanced Forms - Custom Reply-to
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
<?php | |
// add this to `core-emails.php` file in the ACF Advanced Forms plugin ~mj | |
// From header | |
$from = af_resolve_field_includes( $email['from'], $fields ); | |
$replyto = af_get_field( 'email'); | |
$headers[] = 'From:' . $from; | |
// only have reply-to to Customer if it's admin | |
// email address receiving the email; otherwise, the customer will have normal reply-to message ~mj | |
if($email['recipient_type'] == 'custom') { | |
$headers[] = 'Reply-to:' . $replyto; | |
$headers[] = 'Bcc:' . $recipient; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment