import java.text.MessageFormat;
import java.util.Objects;
import javax.ejb.EJB;
-import javax.ejb.EJBException;
import javax.ejb.Stateless;
-import javax.mail.Address;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import org.mxchange.addressbook.database.BaseAddressbookDatabaseBean;
// Call other EJB
User addedUser = this.adminUserBean.addUser(user);
- // Init variable
- Address emailAddress;
-
- try {
- // Create email address and set
- emailAddress = new InternetAddress(addedUser.getUserContact().getContactEmailAddress());
- } catch (final AddressException ex) {
- // Throw again
- throw new EJBException(ex);
- }
-
// Default template is with no random password
String templateName = "user_registration"; //NOI18N
// Send email
// @TODO: Internationlize the subject line somehow
- this.sendEmail("Registration", templateName, emailAddress, addedUser, baseUrl, randomPassword); //NOI18N
+ this.sendEmail("Registration", templateName, addedUser, baseUrl, randomPassword); //NOI18N
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: addedUser={1},addedUser.userId={2} - EXIT!", this.getClass().getSimpleName(), addedUser, addedUser.getUserId())); //NOI18N