benecaster_email_body_html
Filters the HTML body of any Benecaster email before sending. Changes here cascade automatically to the plain text part — the text/plain alternative is auto-generated from the filtered HTML unless benecaster_email_body_text is also used to override it independently.
A type-specific variant is available — append the email type to the hook name (e.g. benecaster_email_body_html_welcome) to target a single type; the $email_type parameter is omitted on the type-specific variant.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$body_html |
string |
— | Email body HTML |
$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_body_html', function( $body_html, $email_type, $user_id, $show_id ) {
// Append a GDPR-compliant data-processing notice to all outgoing emails.
$notice = '<p style="font-size:11px;color:#999;">Your data is processed in accordance with our <a href="https://example.com/privacy">Privacy Policy</a>.</p>';
return $body_html . $notice;
}, 10, 4 );