Skip to main content

benecaster_email_editor_before_episode_notification_send

Action Premium email-editor

Fires when an episode notification starts sending, from cron, once its listeners are recorded and before anyone is mailed.

Parameters

Name Type Default Description
$episode_id int — The episode
$show_id int — Its show
$trigger_key string — `teaser`, or `unlock:` and the slug Benecaster unlocked (`unlock:public` when the episode opens to everyone)
$recipients int — Listeners recorded, less any the episode already had from another of its notifications

Example

add_action( 'benecaster_email_editor_before_episode_notification_send', function ( int $episode_id, int $show_id, string $trigger_key, int $recipients ): void {
    error_log( sprintf( 'Episode %d (%s): %d listeners', $episode_id, $trigger_key, $recipients ) );
}, 10, 4 );

Notes

The listeners come from benecaster_email_editor_episode_notification_recipients. The cron hook that sends them is benecaster_email_editor_episode_notifications_tick: don't schedule it yourself. Walkthrough: Choose who hears about a new episode, and when it counts as new.

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