Skip to content

Prevent SMTP from slowing down wp_mail function

Notifications You must be signed in to change notification settings

wzul/WP-Email-Async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

WP Email Async

Make wp_mail to be sent to wp_cron to ensure faster user experience when WordPress is sending an email. It's an asynchronous-like experience as it will make wp_mail fast by queueing it to the next 2 seconds.

Why WP Cron?

Since an HTTP request to wp cron will not slow down the visitor who happens to visit when the cron job is needed to run, it's best to move the load from the user view to wp cron.

Inside wp-cron.php file, there is:

ignore_user_abort( true );

And, the process will be spawned by the server to server to call the wp-cron.php. Hence, wp cron is simply an excellent candidate to do this expensive task.

Reference

WordPress Stack Exchange

About

Prevent SMTP from slowing down wp_mail function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages