]> git.mxchange.org Git - addressbook-mailer-ejb.git/blobdiff - src/java/org/mxchange/jusercore/model/user/register/AddressbookUserRegistrationSessionBean.java
Please cherry-pick:
[addressbook-mailer-ejb.git] / src / java / org / mxchange / jusercore / model / user / register / AddressbookUserRegistrationSessionBean.java
index 72315aea51358a8d2b6d9e395f74504c03902170..385111d9c1a72c22d88422ca47ea815725bf96f2 100644 (file)
@@ -19,11 +19,7 @@ package org.mxchange.jusercore.model.user.register;
 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;
@@ -183,17 +179,6 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
                // 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
 
@@ -205,7 +190,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
 
                // 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