Skip to content

Instantly share code, notes, and snippets.

@macariojames
Last active September 1, 2019 15:06
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 macariojames/0dc33cdd3fb5e9e833cee6f8f99b5c1c to your computer and use it in GitHub Desktop.
Save macariojames/0dc33cdd3fb5e9e833cee6f8f99b5c1c to your computer and use it in GitHub Desktop.
ACF Advanced Forms - Custom Reply-to
<?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