In this article, you will learn how Listivo's "New Direct Message" email notification works. It is a little different than other email notifications the Listivo sends because we developed some additional functions to make it more friendly for your visitors.
1. There are 2 scenarios when the "New Direct Message" notification email is sent to the user:
A) If the receiver is not active on your website - a "New Direct Message" notification email is sent just after sending him a private message
B) If the receiver is active or was active in the last 5 minutes and hasn't seen it, your website will automatically use WP-Cron system to send an email to him. Listivo wants to send emails only when needed, so when the user is not currently chatting. Please imagine that this "New Direct Message" notification email is sent each time the active user receives the private message - it will be very annoying and Listivo want to avoid it.
2. How does it works by default?
By default Listivo use WP-Cron system to send this email. WP-Cron does not run constantly; it is only triggered on page load. Someone will need to visit your website to trigger sending email functions. In the WordPress it works the same with e.g. Scheduling Posts (learn more here about WP-Cron system)
3. How to make it better and be sure"New Direct Message" notifications are sent in up to 5 minutes
A) Create free accoung at cron-job.org
B) Click "CREATE CRONJOB" button
C) Add Title
D) Fill the URL field same as example below:
Change example http://domain.com/wp-cron.php to your link - please make sure you enter your domain and that it has good protocol (http or https). Make sure the link is finished with: /wp-cron.php as the example above
E) Set execution schedule (Every 1 Minute)
F) Click Create
Done. Cron-job.org will now, every one minute, force WordPress to check your website "Cron Events". "New Direct Message" notification email will be sent in up to 5 minutes to users who are active and are currently not chatting. Users who are offline get emails immediately.
5. You may consider editing to your /wp-config.php this line:
it will disable running wp-cron every time someone accesses the site. It will be executed only via cron-job.com you set up in the point 4