Currently, there are 0 users and 1 guest visiting this topic.
Author
Topic
#64878

Hi,

i failed to find the information about how the plugin works, so here’s the issue :

My setting is : phpmailer + custom smtp, enabled intercept & queue, cron job 30 minutes, and the rest just default.
( what to queue : emails with one or more recipient … )
Then when wp_mail is executed to only 1 user, will the mail goes to database and then sent from background? or should i change the “what to queue” setting?

What if i want the email to send normally but from background ( or directly ), unless suddenly the system need to send 100 emails to 100 users, that’s when the queue starts, but still the first 50 emails ( 1-50 ) straight send normally, then the rest ( 51-100 ) will be send when the cron job executed (30 minutes later).. is that how the plugin works?

Because i don’t think it’s a good thing to wait for the cron job 30 minutes just to send an email? ( i’m using server’s cron job )

Regards,

Topic Information
General Question
7.3
5.5
3.8
Viewing 3 replies - 1 through 3 (of 3 total)
Author
Replies
  • #64879

    Hi,

    Why would you set queue cron to 30 minutes, it is too long. My advice is to keep the queue interval to 5 minutes, depending on the server, it can be even lower at 2 or 3 minutes, if your server is fast enough and if it doesn’t have big email sending limitations.

    All the emails that are intercepted go to the queue, and they are sent when the queue is executed, for the specified time the queue can run, and if more emails remain, they are sent in the next queue run. This is the current execution plan the plugin uses. I will be adding more execution plans in the future.

    If you don’t want every email to go to queue, you can create a function that hooks into plugins interception code and determines if an email is going to queue, or if it will be sent immediately: https://support.dev4press.com/kb/reference/gdmaq_mailer_add_to_queue/.

    There are currently two major features coming in the next 2-3 months: the ability to use the plugin interface to pick which types of emails will go into a queue, and the execution plan that takes into account server email sending limitations.

    Regards,
    Milan

    Dev4Press - Premium plugins for WordPress.

  • #64880

    Hi Milan,

    To clear things up, does “5 minutes” means i need to set cron job to 5 minutes interval too? Is that recommended since i’m trying to optimise the site? ( BTW i’m not using built-in WP Cron, but using server’s cron job to call wp cron )

    Okay so CMIIW, even if the plugin intercepted only one email, it would be run on the next job which is 30 minutes later?
    And if my “Emails per Job” = 50, then intercepted whole 100 mails, that means the first 1-50 mails will be send on minute 30 and 51-100 will be send on minute 60?

    And thanks for the filter, it looks promising !
    In other words i could just intercept all emails and refine it out right?

  • #64883

    Hi,

    Yes, that’s how the queue works, because the plugin always intercepts mail by mail, and the point of the queue is for the queue to decide on the sending process. What you need is that the plugin first decides if some emails should be sent immediately, and some through the queue, and that is not how this works. If an email is intercepted, and if it is eligible for the queue, it goes to queue. And, the queue is run on a schedule, it sends a number of emails, and waits for the next cycle. You can define additional logic for interception using the filter I mentioned.

    As for the queue interval, if you use server cron, you need to have cron match the queue interval to have it work on a set interval. And, it makes little difference how often the server runs the cron. It is one call every 5 minutes (if cron is set to 5 minutes), and it is a fraction of the total times website pages are loaded in the same period. I have it set to 3 minutes on my server (Siteground Cloud hosting), but, any VPS or shared hosting will handle 2 to 5 minutes cron just fine (unless something is seriously wrong with the server).

    Milan

    Dev4Press - Premium plugins for WordPress.

    1 user thanked author for this post.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Register

If you don't have an account on this website, you can register for a free account here:

Register