Skip to main content

Read what the podcaster chose for an episode’s notification

Premium Intermediate Email Editor

The Episode notification section of Ready to Publish? offers the template, an email written for this episode, or none. The choice is kept on the episode, in the post meta _benecaster_email_editor_compose, when it is first published, so a status display (such as a workbench tile) can say using template, composed or skipped.

Code

<?php
$kept   = get_post_meta( $episode_id, '_benecaster_email_editor_compose', true );
$choice = is_array( $kept ) ? ( $kept['choice'] ?? 'template' ) : 'template';

$label = [
    'template' => __( 'Using the notification template', 'my-addon' ),
    'custom'   => __( 'Composed for this episode', 'my-addon' ),
    'none'     => __( 'No notification', 'my-addon' ),
][ $choice ] ?? '';

View on GitHub →

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