PHP code example of adt / mail-queue

1. Go to this page and download the library: Download adt/mail-queue library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adt / mail-queue example snippets


namespace App\Model\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class QueueEntity extends \ADT\MailQueue\Entity\AbstractMailQueueEntry {

	/**
	 * @ORM\Column(type="text")
	 */
	protected $customProperty;

}

$this->mailQueueService->enqueue($mail, [
	'customProperty' => 'customValue'
]);

$this->mailQueueService->enqueue($mail, function (QueueEntity $e) {
	$e->customProperty = 'customValue';
});

$queueService->process()
bash
php www/index.php migrations:diff
php www/index.php migrations:migrate
bash
php www/index.php mail-queue:process
neon
adtMailQueue:
    messenger: #or mailer
    queueEntityClass: #default Entity\MailQueueEntry::class,
    autowireMailer: false
    sendErrorHandler: null
    onQueueDrained: null
    lockTimeout: 600
    limit: 1000 #how many emails send
    tempDir: %tempDir%
    backgroundQueueService: @ADT\BackgroundQueue\Service
    backgroundQueueCallbackName: mailSending