gravitysmtp_notifications_email_digest_frequency_options

Description

The gravitysmtp_notifications_email_digest_frequency_options filter lets developers customize the available frequency option selections for the email activity digest.

Usage

add_filter( 'get_notifications_email_digest_frequency_options', 'your_function_name', 10, 1 );

Parameters

ParameterTypeDescription
$optionsarrayAn array of frequency option arrays. Each option includes:
label (string) – The text label displayed in the UI.
value (int) – The number of days representing the interval.

Default

array(
    array(
        'label' => 'Daily',
        'value' => 1,
    ),
    array(
        'label' => 'Weekly (recommended)',
        'value' => 7,
    ),
    array(
        'label' => 'Monthly',
        'value' => 30,
    ),
);

Examples

Add the option to send every 3 days.

add_filter( 'gravitysmtp_notifications_email_digest_frequency_options', function( $options ) {
    $options[] = array(
        'label' => __( 'Every 3 Days', 'gravitysmtp' ),
        'value' => 3,
    );
    return $options;
});

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This action is located in includes/apps/config/class-settings-config.php

Since

This filter was added in Gravity SMTP 2.0.0