1) A service that sends emails based on a schedule datetime for the individual emails. one or more emails can be put in a comparison group (setting_email_group). if more than one are in the same group, then we are comparing their performance based either setting_email_campaign.total_clicks or setting_email_campaign.total_open (depending on what [url removed, login to view] is true (1) or false (0)). These two values are populated from somewhere else so this would have to be simulated during development.
2) Service will always run on setting_email_campaign.scheduleon. Users can modify this datetime without having to restart the service.
3) email for a campaign will not be sent if [url removed, login to view] is false (0).
4) If the startcompareon is greater than the current date, then the service will clear out the setting_email_group.group_id field and step 1 will happen again. [url removed, login to view] is reached, the service will update setting_email_group.group_id with the campaign in setting_email_campaign with the greatest value in total_clicks or total_open.
5) Service will send emails to those in setting_email_campaign_list. Consider sending an email to no more than 100 recipients at a time. After email is successfully sent, the recipient rows are deleted. This way, it is easy to identify who has not received a specific campaign if there is an error. Each campaign will have their own entry in this table. The same email address can exist more than once if they are in multiple campaigns.
6) service should be multithread
7) values in setting_email_campaign.total_clicks and setting_email_campaign.total_open are automatically updated by our system when users open or click on their email so you will have to simulate.
Where table property is char(36), I use [url removed, login to view]() for the values.
Table structure will be provided in project clarification