I have a website working with a user registration/login system all working also.
I wish to automatically send all users an email that have not used their account for 6 months. I have an idea, but just wondered if there would be a better/more convenient solution.
Because this will be done in PHP, I guess this requires a cron job, which isnt a problem as I have done many of them before. WordPress just doesnt seem to store the last time a user visits my site (to my knowledge). I then thought I could just store in the database (manually) the last time a user visits the site, and run a comparison to the current date in a PHP cron file.
Has anyone got a better suggestion? Or even a plugin to do it for me :p
Thanks!
Take a look at the Transients API. It’s meant to store data temporary. Note, that this doesn’t replace a cron job, as it needs “Action” on the site. So if the site isn’t requested, where you set/alter/delete a Transient, then nothing happens.