if (!adminSecurityCheck(request)){
return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
}
PrivateMessageForm dynaForm = (PrivateMessageForm) form;
PrivateMessageVO pmVO = new PrivateMessageVO();
BeanUtils.copyProperties(pmVO, dynaForm);
//String toMemberEmail = memService.getMemberEmailByMemberId(pm.getGuestEmail());
SystemConfigVO sysConfigVO = sysConfigSerivce.getSystemConfig();
String toMemberEmail = new String();
if(pmVO.getType().equals("contact")){
if (pmVO.getMessageToUserId() != null && pmVO.getMessageToUserId() != ""){
toMemberEmail = memService.getMemberEmailByMemberId(pmVO.getMessageToUserId());
pmVO.setToWebmaster(BaseConstants.BOOLEAN_NO);
pmService.contactMail(pmVO, getLastModifiedBy(request),getCurrentIPAddress(request));
SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
}
else{
toMemberEmail = pmVO.getGuestEmail();
SendMailUtil.sendEmail(pmVO, sysConfigVO);
}
}
else if (pmVO.getType().equals("reply")){
String guestEmail = StringUtil.safeString(pmVO.getGuestEmail());
if ( guestEmail.length() > 0 ){
SendMailUtil.sendEmail(pmVO, sysConfigVO);
}else{
toMemberEmail = memService.getMemberEmailByMemberId(pmVO.getMessageToUserId());
pmVO.setToWebmaster(BaseConstants.BOOLEAN_NO);
pmService.replyMail(pmVO, getLastModifiedBy(request),getCurrentIPAddress(request));
SendMailUtil.memberNewMessageNotification(pmVO, sysConfigVO, toMemberEmail);
}
}
else{