Search code examples
phpwordpressreminders

Reminder to author of wordpress post after exactly 1 month


For a wordpress site I have to implement a reminder that will be send 30 days after the creation of a post in wordpress.

For example:

Author creates a post, 30 days after the creation of this post the author will get a mail on the email-address which he/she filled in at the admin profile dashboard.

The mail needs to contain a url to the original post.

Are there any available plugins that could help me or should I write a custom function ?

Thanks in advance.


Solution

  • The problem you're going to run into is that PHP runs when a user makes a request. So, if no one visits the site on the right day or at the right time, the code you want may not run. And even if they do, do you want to slow down a random users request for this functionality.

    It's best if you look into a Scheduled Task (windows) or Cron Job (linux). These utilities can be used to run PHP scripts at specific times or with specific intervals (every hour, every day at midnight, etc.). Then you create a PHP script that does the work of finding the specific posts and sending emails.

    If your hosting provider doesn't allow access to a scheduling utility. You could setup your own computer, or another computer with a scheduled task to call a specific PHP file that does this work.