Skip to main content

benecaster_email_from_address

Filter Free Since v1.0.0

Filters the sender email address for any Benecaster email. Type-specific variant: benecaster_email_from_address_{type} — 3 params, $email_type omitted.

Parameters

Name Type Default Description
$from_address string Sender email address
$email_type string Email type string
$user_id int|null WordPress user ID; null for admin-only emails
$show_id int|null ID of the show; null when not show-specific

Returns: string

Example

add_filter( 'benecaster_email_from_address', function( $from_address, $email_type, $user_id, $show_id ) {
    // Use a show-specific reply-to address for broadcasts.
    if ( 'broadcast' === $email_type && $show_id ) {
        $custom = get_post_meta( $show_id, '_benecaster_from_email', true );
        return $custom ?: $from_address;
    }
    return $from_address;
}, 10, 4 );