Dockerized email microservice template using Lumen
This is a microservice dockerized template for sending bulk emails using Lumen 8.x. Laravel Queue is used to schedule for sending emails.
Email templates are fully dynamic content, it supports full HTML content.
4 key elements are:
- Entity: Entity will help us to know what the notification is about. For eg, a notification can be about a project or a user etc.
- Entity objects: Entity object are the different types of notifications. For eg, User is a entity and it supported 3 kinds of objects like new user welcome, invitation user, invitation accepted.
- Actor: The actor is the user who is responsible for triggering a notification. If the value is null then it is from company's no-reply email.
- Notifier: Notifier is the user to whom the notification has to be sent.
I am using mailtrap, it is a email sandbox service. Official tutorial can be found here to integrate with Larave/Lumen.
Used technologies
Use the package manager git to install the repo.
git clone https://github.com/jaygaha/notification-microservice.git
cd notification-microservice
docker compose up -d --build
docker compose exec mail-web sh
/var/www/html# php artisan migrate:fresh --seed
If you don't want to use faker data then please omit --seed
Manualy run the schedule
php artisan schedule:run
Create a cron job in the server which run every minute.
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
- API Route (CRUD)
All code submissions will only be evaluated and accepted as pull-requests. If you have any questions or find any bugs please feel free to open an issue.
Feel free to use.