Skip to main content

benecaster_is_transactional_email_type()

Utilities Free
benecaster_is_transactional_email_type( string $type ): bool

Answers whether an email type is transactional (still sent to someone who unsubscribed from announcements) exactly as the send decides it: Benecaster’s own list plus whatever add-ons add through the benecaster_transactional_email_types filter.

Parameters

Name Type Default Required Description
type string — Yes Email type slug, e.g. welcome.

Return Value

Type: bool

true when the type is transactional, so it is still sent to someone who unsubscribed from announcements; false otherwise.

Example

$note = benecaster_is_transactional_email_type( $type )
    ? __( 'Sent even to listeners who unsubscribed from announcements.', 'my-addon' )
    : __( 'Not sent to listeners who unsubscribed.', 'my-addon' );

Hooks Fired

Notes

Do not apply the filter to an empty list yourself. That returns only what add-ons added, not Benecaster's own list. This function is the whole answer.

Transactional does not mean it cannot be unsubscribed from. Someone who unsubscribed from everything still does not receive a transactional email. Only a type registered with 'unsubscribable' => false in benecaster_managed_email_types is sent despite that.

Need this built rather than just documented? See our services →