Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29903

Wordpress - bulk emails from a custom table with a limit of 200 emails / hour

$
0
0

I have developed two custom php forms for user registration and voter registration. The data of both the registrations is saving in two different DB tables. Now further requirement is to develop custom forms for both registrations where only president can send the bulk email (text only) to all (One form for users and other for voters). Currently we have almost 800+ users and 600+ voters.

Developed the form but stucked because of the restriction of 200 emails / hour by the host. Tested the cron job but cron job runs if anyone visit the webiste other wise cron job stucks.

Working from past 48 hours on this but get nothing till now.

Also sharing below the cron job code which i have tested for one minute / email but this code does not work when there is no visitor on the website.

   add_filter( 'cron_schedules', 'isa_add_every_three_minutes' );
    function isa_add_every_three_minutes( $schedules ) {
        $schedules['every_three_minutes'] = array(
                'interval'  => 60,
                'display'   => __( 'Every 3 Minutes', 'textdomain' )
        );
        return $schedules;
}

if ( ! wp_next_scheduled( 'isa_add_every_three_minutes' ) ) {
    wp_schedule_event( time(), 'every_three_minutes', 'isa_add_every_three_minutes' );
}

 add_action( 'isa_add_every_three_minutes', 'every_three_minutes_event_func' );
 function every_three_minutes_event_func() {
$to = get_option( 'admin_email' );    
$headers = "From: "------------ . "\r\n" ;
$headers.= "Reply-To: "-------- . "\r\n" ;
$custom_subject = " Testing Email after one minutes  ";
$subject = "$custom_subject" ;
$custom_message = " Testing email after one minute ";
$message = "$custom_message";

wp_mail($to, $subject, $message, $headers);

}

It is requested to the experienced guys here, please advice some code or some wordpress free plugin in order to solve this problem.

Advance Thanks to all


Viewing all articles
Browse latest Browse all 29903

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>