Email Content creation | Proper design
Posted
by
Umesh Awasthi
on Programmers
See other posts from Programmers
or by Umesh Awasthi
Published on 2014-02-01T10:42:26Z
Indexed on
2014/06/04
9:38 UTC
Read the original article
Hit count: 381
Working on an E commerce application where we need to send so many email to customer like
- Registration email
- Forget Password
- Order placed
There are many other emails that can be sent, I already have emailService
in place which is responsible for sending email and It needs an Email object, Everything is working find, but I am struck at one point and not sure how best this can be done.
We need to create content so as it can be passed to emailService
and not sure how to design this.
For example, in Customer registration, I have a customerFacade
which is working between Controller
and ServiceLayer
, I just want to delegate this Email Content creation work away from Facade layer and to make it more flexible.
Currently I am creating Registration email content inside customerFacade
and some how I am not liking this way, since that means for each email, I need to create content in respective Facade.
What is best way to go or current approach is fine enough?
© Programmers or respective owner