Skip to content
  1. Extras
  2. Sendex
  3. Interface
  4. Email queue

Email queue

Queue formatting

To format a distribution of user emails, it is necessary to add them in the queue:

  • Go to Components -> Sendex

  • On inlay Email queue in the pop-up list choose the distribution, which requires to generate an email.

  • Then you need to send the generated.

Email distribution

There are some ways to distribute emails:

  1. Manual. You need to enter Components -> Sendex, and inlay Email queue. Choose an email and send it through the context menu.

  2. Automatic, through cron. As a unit with addition there is a file core/components/sendex/cron/send.php, which needs to be added it in cron. Frequency of starts depends on quantity of your subscribers and hosting resources, script sends up to 100 emails at one time. An email is deleted from the queue after sending.

  3. Through API.

    php
    $modx->addPackage('sendex', MODX_CORE_PATH . 'components/sendex/model/');
    
    $q = $modx->newQuery('sxQueue');
    $queue = $modx->getCollection('sxQueue');
    /** @var sxQueue $email */
    foreach ($queue as $email) {
      $email->send();
    }