Foros de discusión

sending email verificaton after user creation

john john, modificado hace 11 años.

sending email verificaton after user creation

New Member Mensajes: 23 Fecha de incorporación: 17/12/12 Mensajes recientes
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, modificado hace 11 años.

RE: sending email verificaton after user creation

Junior Member Mensajes: 58 Fecha de incorporación: 6/08/12 Mensajes recientes
you can try using liferay extension
Manuel Mancipe, modificado hace 10 años.

RE: sending email verificaton after user creation

New Member Mensajes: 24 Fecha de incorporación: 2/08/10 Mensajes recientes
Hi Jhon,

I have the same problem,

I use liferay 6.2 CE GA1.

please help me, thank you very much