benecaster_transactional_email_types
Filters the array of email type strings that bypass broadcast opt-out suppression. Types in this array continue to be sent to subscribers who have opted out of broadcast (marketing) emails. They are still suppressed when the subscriber has opted out of all emails — the all-opted-out state is a hard stop regardless of this filter.
The default protected types are: `welcome`, `token_reset`, `token_revoked`, `tier_change`, `migration_reminder`, and `donation_thank_you`. Add-ons that introduce custom transactional email types — access receipts, delivery confirmations, subscription management emails — should add their type strings here. Marketing or promotional types should not be added; they should respect the subscriber’s broadcast opt-out preference. Free — registered regardless of license status.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$types |
array |
— | Array of email type strings that are exempt from broadcast opt-out suppression |
Returns:
array
Examples
Register add-on transactional type
add_filter( 'benecaster_transactional_email_types', function( $types ) {
// Register a custom add-on email type as transactional so it bypasses broadcast opt-outs.
$types[] = 'access_receipt';
return $types;
} );
Add access-restored email type
add_filter( 'benecaster_transactional_email_types', function ( array $types ): array {
$types[] = 'my_addon_access_restored';
return $types;
} );
Notes
Adding a type here only bypasses broadcast opt-out suppression. Subscribers who have opted out of all emails will still not receive this type — the all-opted-out state is always enforced.