I have an system right now where the user can setup to send out emails on a schedule. However, my clients want the ability to only allow 1 scheduled email to go out once a day. If they attempt to schedule another email to go out after it has already gone out that day they want to be able to disable it from going out until the next day.

What would be the best way to approach accomplishing the task? Is there a way I can do this using wp_schedule_single_event ?


Personally, I would have just one (WordPress) cron event that fired daily. All queued emails are stored in a table/option.

Now all you do in your cron handler is grab the next email in the queue, process it, and then delete it. There. One email a day.

You could have the option in the UI that allows users to schedule emails to set a priority, so that it can either be prepended/appended/inserted into the queue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.