benecaster_email_body_text
Filters the plain text version of any Benecaster email. Sent as the text/plain part of the multipart email. If not overridden, the plain text part is auto-generated from the final filtered HTML — meaning changes made via benecaster_email_body_html cascade here automatically. Use this filter when you need the plain text to diverge from the HTML version.
A type-specific variant is available — append the email type to the hook name (e.g. benecaster_email_body_text_welcome) to target a single type; the $email_type parameter is omitted on the type-specific variant.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$body_text |
string |
— | Email plain text body |
$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_text', function( $body_text, $email_type, $user_id, $show_id ) {
// Append an unsubscribe reminder to the plain-text version.
return $body_text . "\n\nManage your subscription preferences via the link in the footer.";
}, 10, 4 );
Need this built rather than just documented? See our services →