Repository for the last open source version of Booked Scheduler. The "develop" branch contains the most current working code of the project and should be considered beta. The "master" branch is the most current stable release of BookedScheduler. Please read doc/README.md for further details.
GNU General Public License v3.0
406
stars
242
forks
source link
PICKME Refactor Email system to builder pattern #426
When I was working on a feature it was quite difficult to implement it because of the current architecture of the email system. This PR holds the current state of my approach, but as it was too risky to break something else I stopped working on it. Maybe it's something for Version 3.0?
The EmailMessage is the base class for all message types and implements an interface. Some of the derived classes have a GetTemplateName method, some don't.
I thought the reason for the architecture is because of a manipulation of the EmailMessage object after it's creation. But it seems that is not the case. All code paths I found create the message and send it to phpmailer without additional modification.
I tried to replace it with a more straighforward builder pattern.
So far I replaced the first view classes with the builder pattern approach. When I came accross GuestAddedEmail wich derives from ReservationEmailMessage things got more complicated. I think this could still be resolved when using a mixture of the builder pattern and the derived class pattern here.
When I was working on a feature it was quite difficult to implement it because of the current architecture of the email system. This PR holds the current state of my approach, but as it was too risky to break something else I stopped working on it. Maybe it's something for Version 3.0?
The
EmailMessage
is the base class for all message types and implements an interface. Some of the derived classes have aGetTemplateName
method, some don't.I thought the reason for the architecture is because of a manipulation of the
EmailMessage
object after it's creation. But it seems that is not the case. All code paths I found create the message and send it to phpmailer without additional modification.I tried to replace it with a more straighforward builder pattern.
So far I replaced the first view classes with the builder pattern approach. When I came accross
GuestAddedEmail
wich derives fromReservationEmailMessage
things got more complicated. I think this could still be resolved when using a mixture of the builder pattern and the derived class pattern here.Todos:
EmailMessage