Background job to send emails using amazon SES with lumen

Now a days email marketing playing big role to market the on-line business. If the business has lot of customer means then we need to handle the sending email to them carefully without affecting application. For this we should handle these things as background process.

Today we are going to learn how to send emails using Amazon SES with background process in lumen framework.

For the background process, We are going to use supervisor process control system. First we are going to install supervisor by using following command

Next we are going to create lumen application command for sending emails .For that we need to create console command for background process which is consist of sending email functionality.

And then add configuration details on .ENV as follows

Also we need to configure Queue driver for Queuing process. I would like to prefer memcached or redis.

Our email command is ready. So Next we are going to configure queue listener(Supervisor) to listen the dispatched data.

  1. Create a configuration file at /etc/supervisor/conf.d/ location “email.conf” for listener deamon process
  2. Edit that file and add following


3. Save it and then restart the supervisor by using following command

From the application the following way to dispatch the job

That’s it. Thank you