# Weekly Email of Upcoming Scheduled Posts

> Emails editors and the admin every Monday with the posts scheduled to publish in the coming week, so everyone knows what is going live and when.

- Type: PHP
- Runs: Run everywhere
- Category: [Email](https://wpide.com/library/category/email/)
- Tags: email, editorial, digest
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/email-weekly-scheduled-posts/

## Code

```php
add_action( 'init', function () {
    if ( wp_next_scheduled( 'wpide_scheduled_posts_email' ) ) {
        return;
    }
    $next = new DateTime( 'monday this week 08:00', wp_timezone() );
    if ( $next->getTimestamp() <= time() ) {
        $next->modify( '+1 week' );
    }
    wp_schedule_event( $next->getTimestamp(), 'weekly', 'wpide_scheduled_posts_email' );
} );

add_action( 'wpide_scheduled_posts_email', function () {
    $posts = get_posts( array(
        'post_type'     => 'any',
        'post_status'   => 'future',
        'numberposts'   => 100,
        'orderby'       => 'date',
        'order'         => 'ASC',
        'no_found_rows' => true,
        'date_query'    => array( array( 'before' => gmdate( 'Y-m-d H:i:s', time() + WEEK_IN_SECONDS ), 'column' => 'post_date_gmt' ) ),
    ) );

    if ( ! $posts ) {
        return;
    }

    $lines = array( 'Scheduled to publish in the next 7 days:', '' );
    foreach ( $posts as $post ) {
        $lines[] = sprintf( '• %s – %s (%s)', get_the_date( 'D j M, H:i', $post ), wp_strip_all_tags( get_the_title( $post ) ), get_the_author_meta( 'display_name', $post->post_author ) );
    }

    $to = array_merge( array( get_option( 'admin_email' ) ), wp_list_pluck( get_users( array( 'role' => 'editor', 'fields' => array( 'user_email' ) ) ), 'user_email' ) );
    wp_mail( array_unique( $to ), sprintf( '[%s] %d post(s) scheduled this week', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), count( $posts ) ), implode( "\n", $lines ) );
} );
```

## Notes

Goes to every user with the Editor role plus the admin email; nothing is sent when no posts are scheduled.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Weekly Email of Upcoming Scheduled Posts" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
