gravityflow_assignee_email_reminder_repeat_days

The gravityflow_assignee_email_reminder_repeat_days filter is used to customize how often the assignee email reminder is sent.

Parameters

int                                  $repeat_days  The number of days between each reminder.
array                              $form              The current form.
array                              $entry             The current entry.
Gravity_Flow_Step        $step              The current step.
Gravity_Flow_Assignee $assignee      The current assignee.

Examples

Example 1 - Change the frequency based on the assignee role.

add_filter( 'gravityflow_assignee_email_reminder_repeat_days', 'sh_email_reminder_repeat', 10, 5 );
function sh_email_reminder_repeat( $repeat_days, $form, $entry, $current_step, $assignee ) {

    //Adjust for your specific step or other conditions
    if ( $current_step->get_id !== 37 ) {
        return $repeat_days;
    }

    $admin = false;

    //Identify whether the current assignee has the adminsitrator role
    switch ( $assignee->get_type() ) {
        case 'user_id':
            $user = get_userdata( $assignee->get_id() );
            if ( in_array( 'administrator', $user->roles ) ) {
                $admin = true;
            }
            break;
        case 'role':
            if ( $assignee->get_id() == 'administrator' ) {
                $admin = true;
            }
            break;
    }

    //Adjust the repeat cycle if the user is an administrator
    if ( $admin == true ) {
        $repeat_days = 15;
    }

    return $repeat_days;
}

Placement

This code should be placed in the functions.php file of your active theme.