Prevent sending opt-in mail when the person is already subscribed

Hi,

How to prevent Mailchimp sending the opt-in mail when the person is already subscribed? And instead of that send an email ‘you are already subscribed’. I found this filter, but don’t know how to achieve this.

add_filter( 'gform_mailchimp_subscription',     function( $subscription, $list_id, $form, $entry, $feed, $member ) {
    if ( $member ) {
        $subscription['status'] = 'subscribed';
    }

    return $subscription;
}, 10, 6 );

That is the correct filter:

The note from that example says:

1. If a subscriber already exists, set them as subscribed

Doing this will avoid the double opt-in for existing members.

You can add that code as is and without modification to your theme functions.php file, or if you’re using a functionality plugin, you can put it there. If you have more questions about the placement of the code, please let us know.

1 Like