2017 © Pedro Peláez
 

library mail

Baka Component for handling email via a simple queue interfase

image

baka/mail

Baka Component for handling email via a simple queue interfase

  • Friday, July 20, 2018
  • by mctekk
  • Repository
  • 4 Watchers
  • 3 Stars
  • 449 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 174 % Grown

The README.md

Phalcon\Mailer

Baka email wrapper for Swiftmailer with queue, (*1)

Configure

SMTP, (*2)

'email' => [
    'driver' => 'smtp',
    'host' => getenv('EMAIL_HOST'),
    'port' => getenv('EMAIL_PORT'),
    'username' => getenv('EMAIL_USER'),
    'password' => getenv('EMAIL_PASS'),
    'from' => [
        'email' => 'noreply@domain.do',
        'name' => 'YOUR FROM NAME',
    ],
    'debug' => [
        'from' => [
            'email' => 'noreply@domain.do',
            'name' => 'YOUR FROM NAME',
        ],
    ],
];

Setup DI

createMessage(), (*3)

$di->set('mail', function () use ($config, $di) {

    //setup
    $mailer = new \Baka\Mail\Manager($config->email->toArray());

    return $mailer->createMessage();
});

Sending a normal email(), (*4)

  $this->mail
    ->to('info@domain.do')
    ->subject('Test Normal Email queue')
    ->content('normal email send via queue')
    ->send();
];

Sending a template normal email(), (*5)

  $this->mail
    ->to('info@domain.dom')
    ->subject('Test Template Email queue')
    ->params(['name' => 'test'])
    ->template('email.volt') //you can also use template() default template is email.volt
    ->send();
];

Sending a normal email instantly, without queue(), (*6)

  $this->mail
    ->to('info@domain.do')
    ->subject('Test Normal Email now')
    ->content('send normal email now')
    ->sendNow();
];

Events

  • mailer:beforeCreateMessage
  • mailer:afterCreateMessage
  • mailer:beforeSend
  • mailer:afterSend
  • mailer:beforeAttachFile
  • mailer:afterAttachFile

Setup CLI


use Phalcon\Cli\Task; /** * Class LsTask * @description('List directory content', 'The content will be displayed in the standard output') */ class MainTask extends Task { use Baka\Mail\JobTrait; }

Running CLI

php app.php main mailqueue email_queue, (*7)

The Versions

20/07 2018

dev-master

9999999-dev

Baka Component for handling email via a simple queue interfase

  Sources   Download

MIT

The Requires

 

The Development Requires

20/07 2018

dev-development

dev-development

Baka Component for handling email via a simple queue interfase

  Sources   Download

MIT

The Requires

 

The Development Requires