use of com.autentia.tnt.bean.util.SendMailBean in project TNTConcept by autentia.
the class ContactBean method sendMail.
/**
* Send e-mail message to contact to notify him about his inclussion in our
* archive of contacts
*
* @return
*/
public String sendMail() {
User actualUser = authManager.getCurrentPrincipal().getUser();
List<String> to = new ArrayList<String>();
to.add(contact.getName() + " <" + contact.getEmail() + ">");
SendMailBean sendMail = (SendMailBean) FacesUtils.getBean("sendMailBean");
sendMail.setFrom(actualUser.getName() + " <" + actualUser.getEmail() + ">");
sendMail.setTo(to);
sendMail.setSubject(FacesUtils.formatMessage("editContact.sendMailSubject"));
sendMail.setMessage(FacesUtils.formatMessage("editContact.sendMailMessage", contact.getName(), actualUser.getName()));
sendMail.addSendMailBeanListener(this);
return OUTCOME_NOTIFY;
}
Aggregations