Search in sources :

Example 1 with SendMailBean

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;
}
Also used : User(com.autentia.tnt.businessobject.User) ArrayList(java.util.ArrayList) SendMailBean(com.autentia.tnt.bean.util.SendMailBean)

Aggregations

SendMailBean (com.autentia.tnt.bean.util.SendMailBean)1 User (com.autentia.tnt.businessobject.User)1 ArrayList (java.util.ArrayList)1