| Line 95... |
Line 95... |
| 95 |
MimeMessage message = mailSender.createMimeMessage();
|
95 |
MimeMessage message = mailSender.createMimeMessage();
|
| 96 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
96 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
| 97 |
|
97 |
|
| 98 |
List<AuthUser> accountsAuthUserList = csService.getAuthUserIds(ProfitMandiConstants.TICKET_CATEGORY_ACCOUNTS, Arrays.asList(EscalationType.L1, EscalationType.L2));
|
98 |
List<AuthUser> accountsAuthUserList = csService.getAuthUserIds(ProfitMandiConstants.TICKET_CATEGORY_ACCOUNTS, Arrays.asList(EscalationType.L1, EscalationType.L2));
|
| 99 |
List<String> accountTeamMails = accountsAuthUserList.stream().map(x->x.getEmailId()).collect(Collectors.toList());
|
99 |
List<String> accountTeamMails = accountsAuthUserList.stream().map(x->x.getEmailId()).collect(Collectors.toList());
|
| - |
|
100 |
accountTeamMails.add("neeraj.gupta@smartdukaan.com");
|
| 100 |
|
101 |
|
| 101 |
List<AuthUser> salesAuthUserList = csService.getAuthUserIds(ProfitMandiConstants.TICKET_CATEGORY_SALES, Arrays.asList(EscalationType.L1, EscalationType.L2));
|
102 |
List<AuthUser> salesAuthUserList = csService.getAuthUserIds(ProfitMandiConstants.TICKET_CATEGORY_SALES, Arrays.asList(EscalationType.L1, EscalationType.L2));
|
| 102 |
List<String> salesTeamMails = salesAuthUserList.stream().map(x->x.getEmailId()).collect(Collectors.toList());
|
103 |
List<String> salesTeamMails = salesAuthUserList.stream().map(x->x.getEmailId()).collect(Collectors.toList());
|
| - |
|
104 |
|
| - |
|
105 |
List<AuthUser> abmAuthUserList = csService.getAuthUserIds(ProfitMandiConstants.TICKET_CATEGORY_ABM, Arrays.asList(EscalationType.L1, EscalationType.L2));
|
| - |
|
106 |
List<String> abmTeamMails = abmAuthUserList.stream().map(x->x.getEmailId()).collect(Collectors.toList());
|
| - |
|
107 |
|
| - |
|
108 |
List<AuthUser> categoryAuthUserList = csService.getAuthUserIds(ProfitMandiConstants.TICKET_CATEGORY_ABM, Arrays.asList(EscalationType.L1, EscalationType.L2,EscalationType.L3));
|
| - |
|
109 |
List<String> categoryTeamMails = categoryAuthUserList.stream().map(x->x.getEmailId()).collect(Collectors.toList());
|
| - |
|
110 |
|
| 103 |
List<String> allEmails = new ArrayList<>(Arrays.asList(
|
111 |
List<String> allEmails = new ArrayList<>(Arrays.asList(
|
| 104 |
"sm@smartdukaan.com",
|
112 |
"sm@smartdukaan.com",
|
| 105 |
"manish.gupta1@smartdukaan.com",
|
- |
|
| 106 |
"tarun.verma@smartdukaan.com",
|
113 |
"tarun.verma@smartdukaan.com"
|
| 107 |
"niranjan.kala@smartdukaan.com",
|
- |
|
| 108 |
"mohit.gulati@smartdukaan.com"
|
- |
|
| 109 |
// "tejus.lohani@smartdukaan.com"
|
- |
|
| 110 |
));
|
114 |
));
|
| 111 |
|
115 |
|
| 112 |
allEmails.addAll(salesTeamMails);
|
- |
|
| 113 |
allEmails.addAll(accountTeamMails);
|
- |
|
| 114 |
|
- |
|
| 115 |
// niranjan kala(authId -54) Team Emails,
|
116 |
// niranjan kala(authId -54) Team Emails,
|
| 116 |
List<Integer> allReportees = authService.getAllReportees(54);
|
117 |
List<Integer> allReportees = authService.getAllReportees(54);
|
| 117 |
List<AuthUser> authUsers = authRepository.selectAllAuthUserByIds(allReportees);
|
118 |
List<AuthUser> authUsers = authRepository.selectAllAuthUserByIds(allReportees);
|
| 118 |
List<String> categotyTeamEmails = authUsers.stream().map(x -> x.getEmailId()).collect(Collectors.toList());
|
119 |
List<String> categotyTeamEmails = authUsers.stream().map(x -> x.getEmailId()).collect(Collectors.toList());
|
| 119 |
|
120 |
|
| 120 |
allEmails.addAll(categotyTeamEmails);
|
121 |
allEmails.addAll(categotyTeamEmails);
|
| 121 |
String[] emailTo = allEmails.toArray(new String[allEmails.size()]);
|
122 |
String[] emailTo = allEmails.toArray(new String[allEmails.size()]);
|
| 122 |
helper.setSubject(subject);
|
123 |
helper.setSubject(subject);
|
| 123 |
helper.setText(messageText, true);
|
124 |
helper.setText(messageText, true);
|
| 124 |
helper.setTo(emailTo);
|
125 |
helper.setTo(emailTo);
|
| - |
|
126 |
|
| - |
|
127 |
List<String> bccEmails = new ArrayList<>();
|
| - |
|
128 |
bccEmails.addAll(salesTeamMails);
|
| - |
|
129 |
bccEmails.addAll(accountTeamMails);
|
| - |
|
130 |
bccEmails.addAll(categoryTeamMails);
|
| - |
|
131 |
bccEmails.addAll(abmTeamMails);
|
| - |
|
132 |
|
| - |
|
133 |
String[] emailBcc = bccEmails.toArray(new String[0]);
|
| - |
|
134 |
helper.setBcc(emailBcc);
|
| - |
|
135 |
|
| 125 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smart Dukaan");
|
136 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smart Dukaan");
|
| 126 |
helper.setFrom(senderAddress);
|
137 |
helper.setFrom(senderAddress);
|
| 127 |
mailSender.send(message);
|
138 |
mailSender.send(message);
|
| 128 |
|
139 |
|
| 129 |
}
|
140 |
}
|