Hi,
I would probably opt to create models for BookingConfirmation
, BookingReminder
and BookingCancellation
, which I would be creating in the controller using REST.
My main goal would be that I would have a trace of what confirmations/reminders/cancellation notices that were sent to the customer. If you want to make it more generic, you could create a model BookingNotification
and assign a type to it.
The dispatching of mails I would probably write in a event listener on the created
event of that model; if you have one model, you could just add a case to send one of the three mails. I know I'm a bit fanatic when it comes to tracing and audit trails, but I like to be able to check when these notifications were triggered (and by what user), and this would achieve just that.
Also - why are you putting this in a namespace <...>/Sessions
- as a new developer on your project, I would probably not immediately start looking into that namespace :-)
I hope this helps - there is no right or wrong here, but this is how I would go around this.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community