|
10 | 10 | import org.mskcc.cbio.oncokb.domain.Company;
|
11 | 11 | import org.mskcc.cbio.oncokb.domain.UserMessagePair;
|
12 | 12 | import org.mskcc.cbio.oncokb.domain.enumeration.MailType;
|
13 |
| -import org.mskcc.cbio.oncokb.service.dto.TerminationEmailDTO; |
14 | 13 | import org.mskcc.cbio.oncokb.service.dto.UserDTO;
|
15 | 14 | import org.mskcc.cbio.oncokb.service.dto.UserMailsDTO;
|
16 | 15 | import org.mskcc.cbio.oncokb.web.rest.vm.ExposedToken;
|
@@ -86,20 +85,6 @@ private UnknownMailTypeException() {
|
86 | 85 | }
|
87 | 86 | }
|
88 | 87 |
|
89 |
| - public void sendEmail(TerminationEmailDTO dto) throws MessagingException { |
90 |
| - log.debug("Send email to company ID '{}' with subject '{}' and content={}", |
91 |
| - dto.getCompanyId(), dto.getSubject(), dto.getContent()); |
92 |
| - |
93 |
| - MimeMessage mimeMessage = javaMailSender.createMimeMessage(); |
94 |
| - MimeMessageHelper message = new MimeMessageHelper(mimeMessage, false, StandardCharsets.UTF_8.name()); |
95 |
| - message.setFrom(dto.getFrom()); |
96 |
| - message.setBcc(dto.getBcc().split(";")); |
97 |
| - message.setCc(dto.getCc().split(";")); |
98 |
| - message.setSubject(dto.getSubject()); |
99 |
| - message.setText(dto.getContent(), false); |
100 |
| - javaMailSender.send(mimeMessage); |
101 |
| - } |
102 |
| - |
103 | 88 | @Async
|
104 | 89 | public void sendEmail(String to, String from, String cc, String subject, String content, List<String> attachmentFilesNames, boolean isMultipart, boolean isHtml) throws MessagingException {
|
105 | 90 | log.debug("Send email[multipart '{}' and html '{}'] to '{}' with subject '{}' and content={}",
|
@@ -251,21 +236,6 @@ public void sendEmailFromTemplate(UserDTO user, MailType mailType, String subjec
|
251 | 236 | }
|
252 | 237 | }
|
253 | 238 |
|
254 |
| - public void sendInternalEmailFromTemplate(MailType mailType, String subject, String to, Context additionalContext) { |
255 |
| - Context context = new Context(Locale.ENGLISH); |
256 |
| - |
257 |
| - if (additionalContext != null) |
258 |
| - additionalContext.getVariableNames().forEach(name -> context.setVariable(name, additionalContext.getVariable(name))); |
259 |
| - |
260 |
| - String from = jHipsterProperties.getMail().getFrom(); |
261 |
| - String content = templateEngine.process("mail/" + mailType.getTemplateName(), context); |
262 |
| - try { |
263 |
| - sendEmail(to, from, null, subject, content, null, false, true); |
264 |
| - } catch (MailException | MessagingException e) { |
265 |
| - log.warn("Internal email could not be sent to '{}'", to, e); |
266 |
| - } |
267 |
| - } |
268 |
| - |
269 | 239 | @Async
|
270 | 240 | public void sendActivationEmail(UserDTO user) {
|
271 | 241 | log.debug("Sending activation email to '{}'", user.getEmail());
|
|
0 commit comments