@Override @Transactional public void sendAdminChangePasswordNotification(Map<String, Object> obj) { try { this.simpleMailMessage.setTo(obj.get("emailId").toString()); Email mail = this.getMailTemplate(CHANGE_PASSWORD_BY_ADMIN); this.simpleMailMessage.setSubject(mail.getSubject()); String text = "Text mode not supported, please turn on Standard mode."; String text1 = String.format(mail.getValue(), obj.get("empname"), obj.get("newpassword")); this.sendMail(text, text1, null); } catch (Exception ex) { ex.printStackTrace(); logger.error("Exception in Method:sendAdminChangePasswordNotification", ex); } }
@Override @Transactional public void sendTSSubmitNotificationToMgr(Map<String, Object> obj, int status) { try { this.simpleMailMessage.setTo(obj.get("toemailid").toString()); this.simpleMailMessage.setCc(obj.get("ccemailid").toString()); Email mail = new Email(); String text1 = new String(); if (status == 4) { mail = this.getMailTemplate(TIMESHEET_SUBMIT_NOTIFICATION); text1 = String.format( mail.getValue(), obj.get("toname"), obj.get("ccname"), obj.get("dateweek"), obj.get("status")); } if (status == 6) { mail = this.getMailTemplate(TIMESHEET_ARROVAL_NOTIFICATION); text1 = String.format( mail.getValue(), obj.get("ccname"), obj.get("toname"), obj.get("dateweek"), obj.get("status")); } if (status == 5) { mail = this.getMailTemplate(TIMESHEET_REJECTED_NOTIFICATION); text1 = String.format( mail.getValue(), obj.get("ccname"), obj.get("toname"), obj.get("dateweek"), obj.get("status")); } this.simpleMailMessage.setSubject(mail.getSubject()); String text = "Text mode not supported, please turn on Standard mode."; this.sendMail(text, text1, null); } catch (Exception ex) { ex.printStackTrace(); logger.error("Exception in Method:sendTSSubmitNotificationToMgr", ex); } }