Documentation > Developers > Filter Examples > Add Reply-To Email Header to Approval Email

Add Reply-To Email Header to Approval Email

The following snippet will add a Reply-To header to the client, who has just approved their selection.

function my_picu_email_headers( $headers, $mail_context, $collection_id, $ident ) {
    if ( $mail_context == 'photographer_collection_approved' && function_exists( 'picu_get_email_from_ident' ) ) {
        // Get the client email address
        $email = picu_get_email_from_ident( $collection_id, $ident );
        if ( is_email( $email ) ) {
            $headers .= "Reply-To: " . $email . "\r\n";
        }
    }

    return $headers;
}

add_filter( 'picu_email_headers', 'my_picu_email_headers', 10, 4 );Code language: PHP (php)

Need help?

If you couldn’t find what you were looking for and need more assistance, please get in touch with us directly and we’re happy to help.