2017 © Pedro Peláez
 

library zf-email-in-background

image

interactive-solutions/zf-email-in-background

  • Wednesday, May 23, 2018
  • by mac_nibblet
  • Repository
  • 3 Watchers
  • 0 Stars
  • 791 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 11 Versions
  • 6 % Grown

The README.md

InteractiveSolutions\EmailInBackground

This is a integration module between RoaveEmailTemplates and InteractiveSolutions\ZfBernard and it allows a very simple method of sending emails in the background., (*1)

Installation

Simple installation via composer, (*2)

composer require interactive-solutions/zf-email-in-background, (*3)

Configuration

None, it's already handled for you by the module, (*4)

Usage

Assuming you have access to the bernard producer InteractiveSolutions\Bernard\Producer you simply want to produce a new message that is an instance of InteractiveSolutions\EmailInBackground\SendEmailMessage, (*5)

Example, (*6)

$args = [
    'activationKey' => 'helloWorld'
];

$producer->producer(new SendEmailMessage('email@google.com', 'user:registration', $args));

And voila, you have produced a new message that will send an email in a background task, (*7)

Running the code in development

Run this command in a terminal for the application root, (*8)

php public/index.php interactive-solutions:bernard:consume emails, (*9)

Running the code in production

When running in production you either want a docker container that is running the consume command or have a supervisord process running it., (*10)

Example supervisor configuration, (*11)

[program:emails-in-background]
command=php <path to app root>/public/index.php interactive-solutions:bernard:consume emails
autostart=true
autorestart=true
stderr_logfile=<path to app root>/data/logs/supervisor/emails.err.log
stdout_logfile=<path to app root>/data/logs/supervisor/emails.out.log
user=www-data
group=www-data

The Versions

21/05 2018

dev-feature/override-reply-to

dev-feature/override-reply-to https://github.com/interactives-solutions/zf-email-in-background

  Sources   Download

MIT

The Requires

 

08/02 2017