96 |
this.duplicateCount = duplicateCount; |
this.duplicateCount = duplicateCount; |
97 |
} |
} |
98 |
|
|
99 |
public void sendRapport() { |
public void sendRapport(boolean failed) { |
100 |
logger.info("Sending mail"); |
logger.info("Sending mail, failed:" + failed); |
101 |
|
|
102 |
String reportData = getReportData(); |
String reportData = getReportData(); |
103 |
|
|
104 |
String subject = "Adresse indlæsnings rapport for " + source.getDistributor(); |
String subject = "Adresse indlæsnings rapport for " + source.getDistributor(); |
105 |
|
|
106 |
|
if (failed) { |
107 |
|
subject = "Error: too many closed addresses for " + source.getDistributor(); |
108 |
|
reportData = "<h1><font color='red'>Data er IKKE skrevet til DB</font></h1><br>\r\n" + reportData; |
109 |
|
} |
110 |
|
|
111 |
String newOpenCloseAttachment = getAttachement(); |
String newOpenCloseAttachment = getAttachement(); |
112 |
|
|
113 |
MailSender.sendMailWithAttachment(subject, reportData, "Details.csv", newOpenCloseAttachment); |
MailSender.sendMailWithAttachment(subject, reportData, "Details.csv", newOpenCloseAttachment); |