ready
This commit is contained in:
@@ -171,21 +171,22 @@ public class ReportGenerationService {
|
||||
persistReport(req, rb);
|
||||
|
||||
// Отправляем PDF на email, если указан email и формат PDF
|
||||
if (req.getRecipientEmail() != null && !req.getRecipientEmail().trim().isEmpty()
|
||||
&& "PDF".equalsIgnoreCase(req.getFormat())) {
|
||||
try {
|
||||
emailService.sendReportByEmail(
|
||||
req.getRecipientEmail(),
|
||||
req.getReportTitle(),
|
||||
req.getAuthorName(),
|
||||
req.getCompanyName(),
|
||||
rb.getBytes(),
|
||||
rb.getFilename());
|
||||
} catch (Exception e) {
|
||||
System.err.println("Ошибка при отправке email: " + e.getMessage());
|
||||
// Не прерываем выполнение, если email не отправился
|
||||
}
|
||||
}
|
||||
// if (req.getRecipientEmail() != null &&
|
||||
// !req.getRecipientEmail().trim().isEmpty()
|
||||
// && "PDF".equalsIgnoreCase(req.getFormat())) {
|
||||
// try {
|
||||
// emailService.sendReportByEmail(
|
||||
// req.getRecipientEmail(),
|
||||
// req.getReportTitle(),
|
||||
// req.getAuthorName(),
|
||||
// req.getCompanyName(),
|
||||
// rb.getBytes(),
|
||||
// rb.getFilename());
|
||||
// } catch (Exception e) {
|
||||
// System.err.println("Ошибка при отправке email: " + e.getMessage());
|
||||
// // Не прерываем выполнение, если email не отправился
|
||||
// }
|
||||
// }
|
||||
|
||||
return rb;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user