I am developing an email module into the Backend of an app which sends an email with a different template depending on an event. Each event returns a status of True
or False
. When False
, an email is supposed to be sent out which depends on that particular event which returned False. What is the best design pattern, light, scalable, reusable to use for this feature, which i could easily extend to more triggers? Would it be the observer pattern?
decorator? match case? something else?
event 1(args) => email( args ){template1(args)}
event 2(args) => email( args ){template2(args)}
event 3(args) => email( args ){template3(args)}
event 4(args) => email( args ){template4(args)}
Aucun commentaire:
Enregistrer un commentaire