stesi / mail-dispatcher
Inserts the email to be sent to the database and after sends them. This project use Propel2 as ORM.
Installs: 52
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=5.6
- composer/composer: 1.1.2
- phpmailer/phpmailer: 6.0.0rc2
- propel/propel: dev-master
This package is not auto-updated.
Last update: 2025-05-10 23:00:24 UTC
README
Usage:
//Create new template and set param to substitute in template
$template = (new Template ())
->setTemplateName ( "test" )
->addKeyVal ( (new KeyVal ())
->setKey ( "Name" )
->setVal ( "Mauro" ) )
->addKeyVal ( (new KeyVal ())
->setKey ( "Surname" )
->setVal ( "Cerone" ) )
->addKeyVal ( (new KeyVal ())
->setKey ( "NickName" )
->setVal ( "ceronem" ) );
//Create contact, FROM and A
$a = (new Contact ())->setAddress("cerone.m@stesi.eu");
$from = (new Contact())->setAddress("mauro.cerone@gmail.com");
//Add contact and template to Email object
$email = (new Email())
->setTemplate($template)
->setFrom($from)
->addA($a)
->setSubject("Test Email");
//Add email to the send queue
STeSI\MailDispatcher\Mailer::addMailToSend($email);
//Send all mail in send queue
STeSI\MailDispatcher\Mailer::startSendOperation();