EmailSenderProgram is an application that sends mail to customers. Today it sends two types of mails; "Welcome Mail" to new customers and "Comeback mail" to inactive customers. The application run every day at 12.00 as a scheduled task. When the application is done, it writes the results. new customers - it's customers registered earlier than 1 day. inactive customers - customers that don't have any orders.
We want to have possibilities to add more email-types or change output.
The code is not good in any way.
It contains obvious bugs, some wrong assumptions and is quite ugly.
Your task is to do the code in the script.php better so it will be easy to add more email-types, output management or other improvements.
We want code that is easy to read, easy to understand and is robust. It should be easy to modify and continue to build on.
Modify the code in script.php or create other files which will do all functionality. Write down what you are thinking about the code, which defects you have identified and how you work with the code.
Don't modify Datalayer, even if it's not perfect it's not in this task.