• Good day.

    Is it possible for queued mails to be sent when using wp-cli?
    For example, it is possible to run all due wp_cron jobs using wp cron event run --due-now

    So far queued mails are not being sent when triggering cron.

    I assume it is because of the process_key?

    If so, is there a way to send mails via cron without a requirement for the process_key?

    Thanks for your time.
    Charles

    • This topic was modified 1 year, 10 months ago by fioru.
    • This topic was modified 1 year, 10 months ago by fioru.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter fioru

    (@fioru)

    Ah. Sending requires $_GET[''smqProcessQueue] to be set.

    The following seems to work.

    wp cron event run --due-now --exec='$_GET["smqProcessQueue"]=1;'

    Could you elaborate on the reason for making the query param required?

    • This reply was modified 1 year, 10 months ago by fioru.
    Plugin Author Birmania

    (@birmania)

    Hi @fioru,

    You did well adding this parameter to the query.
    By default (when the parameter is not set), the plugin will override the wp_mail function in order to replace its behavior from call to SMTP server to a simple local queuing of the mail content.

    When you pass the smqProcessQueue parameter, the plugin will not override the wp_mail function and, in addition, it will run the code that peek mails from the queue and send them (using the original wp_mail function).

    Do not hesitate to tell me if it is not clear.
    Yours faithfully,
    Birmania

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp cron event run’ is closed to new replies.