Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
john john
sending email verificaton after user creation
January 9, 2013 6:27 AM
Answer

john john

Rank: New Member

Posts: 23

Join Date: December 17, 2012

Recent Posts

Hi,

I want to send an email verification after user creation...

for that i followed the following steps..

User user = UserLocalServiceUtil.addUser(creatorUserId, companyId, autoPassword, password1, password2,
autoScreenName, screenName, emailAddress, facebookId, openId, locale, firstName, middleName, lastName,
prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds,
roleIds, userGroupIds, sendEmail, serviceContext);

registrant.setUserId(user.getUserId());
registrant.setContactId(user.getContactId());



// Disable the ability to login until someone approves the account.
//if (!active) {
UserLocalServiceUtil.updateStatus(user.getUserId(), user.getStatus());
// }

// Add mobile phone.
updateMobilePhone(creatorUserId, companyId, registrant);

UserLocalServiceUtil.sendEmailAddressVerification(user, emailAddress, serviceContext);

but i am getting the following exception..

No Layout exists with the primary key 0
at com.liferay.portal.service.persistence.LayoutPersistenceImpl.findByPrimaryKey(LayoutPersistenceImpl.java:943)
at com.liferay.portal.service.base.LayoutLocalServiceBaseImpl.getLayout(LayoutLocalServiceBaseImpl.java:401)
at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy84.getLayout(Unknown Source)
at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy85.getLayout(Unknown Source)
at com.liferay.portal.service.impl.UserLocalServiceImpl.sendEmailAddressVerification(UserLocalServiceImpl.java:3209)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


any help would be much appreciated...
S P
RE: sending email verificaton after user creation
January 9, 2013 8:27 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

you can try using liferay extension
Manuel Mancipe
RE: sending email verificaton after user creation
December 16, 2013 8:41 AM
Answer

Manuel Mancipe

Rank: New Member

Posts: 18

Join Date: August 2, 2010

Recent Posts

Hi Jhon,

I have the same problem,

I use liferay 6.2 CE GA1.

please help me, thank you very much