No Registration Confirmation Email Sent

  • Bruno Nadeau
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 1 month ago #2625 by Bruno Nadeau
No Registration Confirmation Email Sent was created by Bruno Nadeau
Hi.

While debugging my donation forms and I noticed that a new user is created correctly in my database, but that the registration confirmation email is never sent. This means that the user can not log in after processing his first donation.

Any idea how to solve this issue? I'm integrating Joom Donation with Community Builder.

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #2626 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:No Registration Confirmation Email Sent
Hi

Right now, when you allow user registration in Joom Donation to Yes, Users will be able to login as soon as they complete donation. No need for confirmation in this case .

Thanks,
Tuan

Please Log in or Create an account to join the conversation.

  • Bruno Nadeau
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 1 month ago #2627 by Bruno Nadeau
Replied by Bruno Nadeau on topic Re:No Registration Confirmation Email Sent
Thanks for the quick response.

So I have Joom Donation installed and setup to integrate with Community Builder.

The first thing I had to do is change my setup a bit. Community Builder gives the option of managing registration ONLY through CB (which is the recommended option), and that means turning off the main Joomla option "Allow User Registration". That was conflicting with Joom Donation, so I turned it back on. Everything was fine.

But, I still need new users to confirm their account. So I have "New User Account Activation" set to yes in Joomla's Global Configuration and "Require Email Confirmation" set to yes as well in CB. I need this because users can register through the normal registration form, not only by making a donation.

Which leads me to my problem, when a new user completes his/her first donation, their new account is created, but they can not login (account not confirmed) and no activation email was sent.

Any suggestion?

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #2628 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:No Registration Confirmation Email Sent
Hi
For registration integration option within Joom Donation, currently, the extension only works well with core Joomla registration, not work with CB registration, sorry about that .

If you give me FTP account of your site, I am happy to do this customization for you .

Thanks,
Tuan

Please Log in or Create an account to join the conversation.

  • Bruno Nadeau
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 1 month ago #2638 by Bruno Nadeau
Replied by Bruno Nadeau on topic Re:No Registration Confirmation Email Sent
I need this fairly soon, so I'm going to give it a try in the next few days. I've added and change a few things to my Joom Donation install so I'm starting to understand how everything fits together.

But, I've never integrated anything with CB, which seems painful.

Any suggestion on how you might approach this would be appreciated.

My first thought is to modifed the 'models/jdonation.php' file, and to add an if statement in the 'processDonation(...)' function like this:
Code:
if ($config->registration_integration == 2) { $userId = $this->_saveRegistrationCB(); } else { $userId = $this->_saveRegistration(); }

Then add the _saveRegistrationCB() function that calls the proper CB registration. The thing that's confusing me at this point is how to 'import' and use comprofiler properly within Joom Donation.

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #2642 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:No Registration Confirmation Email Sent
Hi
I will spend sometime today to work on this integration and update code to server. I will let you know when it is done .

Thanks,
Tuan

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #2646 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:No Registration Confirmation Email Sent
Hi
As promised, I worked on it and completed the feature. You can login to your account, access to your orders menu item to download the latest version, re-install it on your site . It will work as expected .

Thanks,
Tuan

Please Log in or Create an account to join the conversation.

  • Bruno Nadeau
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 1 month ago #2649 by Bruno Nadeau
Replied by Bruno Nadeau on topic Re:No Registration Confirmation Email Sent
Awesome thanks. That was fast. I don't see any document in my Orders list. I think I purchase the joomdonation + docman bundle before getting the account for the forum. Not sure if that matters or not.

Also, can you tell me which files you had to modify? I made a bunch of changes to the code, some fixes and some addition for another payment gateway, so I would like to just copy/paste what you changed.

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #2650 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:No Registration Confirmation Email Sent
Hi
I sent you the latest version via email . Please check your email to get it . There is only one file was modified is components/com_jdonation/models/jdonation.php

Thanks,
Tuan

Please Log in or Create an account to join the conversation.

  • Bruno Nadeau
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 1 month ago #2653 by Bruno Nadeau
Replied by Bruno Nadeau on topic Re:No Registration Confirmation Email Sent
I ended up extending the code quite a bit to make it work like I needed.

Instead of using the normal joomla registration and then copying the values to the CB table, I needed to use the CB registration process for a few reasons, one of which is that I need to sent a Confirmation email so that new users can't log in right away.

Below is the code I used, it might be useful for you later on. I added a check for "$config->cb_integration == 1" in the processDonation function of "models/jdonation.php" so that if CB integration is active, then it calls this new function I added:
Code:
function _saveRegistrationCB() { global $_CB_framework, $_CB_database, $ueConfig, $_POST, $_PLUGINS; require_once( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_comprofiler'.DS.'plugin.class.php' ); require_once( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_comprofiler'.DS.'comprofiler.class.php' ); include_once( JPATH_SITE.DS.'components'.DS.'com_comprofiler'.DS.'plugin'.DS.'language'.DS.'default_language'.DS.'default_language.php'); if ( ( ( $_CB_framework->getCfg( 'allowUserRegistration' ) == '0' ) && ( ( ! isset($ueConfig['reg_admin_allowcbregistration']) ) || $ueConfig['reg_admin_allowcbregistration'] != '1' ) ) || $_CB_framework->myId() ) { cbNotAuth(); return; } if ( ! isset( $ueConfig['emailpass'] ) ) { $ueConfig['emailpass'] = '0'; } $userComplete = new moscomprofilerUser( $_CB_database ); $_PLUGINS->loadPluginGroup('user'); $_PLUGINS->trigger( 'onStartSaveUserRegistration', array() ); if( $_PLUGINS->is_errors() ) { echo "<script type=\"text/javascript\">alert('".addslashes($_PLUGINS->getErrorMSG())."'); </script>\n"; $oldUserComplete = new moscomprofilerUser( $_CB_database ); $userComplete->bindSafely( $_POST, $_CB_framework->getUi(), 'register', $oldUserComplete ); HTML_comprofiler::registerForm( $option, $ueConfig['emailpass'], $userComplete, $_POST, $_PLUGINS->getErrorMSG("<br />") ); return; } $username = cbGetParam( $_POST, 'username', '' ); if ( isset( $_POST['acceptedterms'] ) ) { $userComplete->acceptedterms = ( (int) cbGetParam( $_POST, 'acceptedterms', 0 ) == 1 ? 1 : 0 ); } else { $userComplete->acceptedterms = null; } if($ueConfig['reg_enable_toc']) { if ( $userComplete->acceptedterms != 1 ) { echo "<script type=\"text/javascript\">alert('" . addslashes( unHtmlspecialchars( _UE_TOC_REQUIRED ) ) ."'); </script>\n"; $oldUserComplete = new moscomprofilerUser( $_CB_database ); $userComplete->bindSafely( $_POST, $_CB_framework->getUi(), 'register', $oldUserComplete ); return; } } $userComplete->id = 0; $userComplete->registeripaddr = cbGetIPlist(); $config = $this->getConfig(); $cbPost['name'] = JRequest::getVar('name', '') ; $cbPost[$config->m_firstname] = JRequest::getVar('first_name', '', 'post'); $cbPost[$config->m_lastname] = JRequest::getVar('last_name', '', 'post'); $cbPost[$config->m_organization] = JRequest::getVar('organization', '', 'post'); $cbPost[$config->m_address] = JRequest::getVar('address', '', 'post'); $cbPost[$config->m_address2] = JRequest::getVar('address2', '', 'post'); $cbPost[$config->m_city] = JRequest::getVar('city', '', 'post'); $cbPost[$config->m_state] = JRequest::getVar('state', '', 'post'); $cbPost[$config->m_zip] = JRequest::getVar('zip', '', 'post'); $cbPost[$config->m_country] = JRequest::getVar('country', '', 'post'); $cbPost[$config->m_phone] = JRequest::getVar('phone', '', 'post'); $cbPost[$config->m_fax] = JRequest::getVar('fax', '', 'post'); $cbPost['gid'] = $_CB_framework->acl->get_group_id( $row->usertype, 'ARO' ); $cbPost['usertype'] = $_CB_framework->getCfg( 'new_usertype' ); $cbPost['username'] = JRequest::getVar('username', '', 'post'); $cbPost['password'] = JRequest::getVar('password', ''); $cbPost['password__verify'] = JRequest::getVar('password2', ''); $cbPost['email'] = JRequest::getVar('email', '', 'post'); $saveResult = $userComplete->saveSafely( $cbPost, $_CB_framework->getUi(), 'register' ); if ( $saveResult === false ) { echo "<script type=\"text/javascript\">alert('" . str_replace( '\\\\n', '\\n', addslashes( strip_tags( str_replace( '<br />', '\n', $userComplete->getError() ) ) ) ) ."'); </script>\n"; return -1; } if ( $saveResult['ok'] === true ) { $messagesToUser = activateUser( $userComplete, 1, "UserRegistration" ); } foreach ( $saveResult['tabs'] as $res ) { if ($res) { $messagesToUser[] = $res; } } if ( $saveResult['ok'] === false ) { echo "<script type=\"text/javascript\">alert('" . str_replace( '\\\\n', '\\n', addslashes( strip_tags( str_replace( '<br />', '\n', $userComplete->getError() ) ) ) ) . "'); </script>\n"; return -1; } $_PLUGINS->trigger( 'onAfterUserRegistrationMailsSent', array( &$userComplete, &$userComplete, &$messagesToUser, $ueConfig['reg_confirmation'], $ueConfig['reg_admin_approval'], true)); foreach ( $saveResult['after'] as $res ) { if ( $res ) { echo "\n<div>" . $res . "</div>\n"; } } if ( $_PLUGINS->is_errors() ) { echo $_PLUGINS->getErrorMSG(); return -1; } echo "\n<div>" . implode( "</div>\n<div>", $messagesToUser ) . "</div>\n"; return $userComplete->id; }

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamDũng Nguyễn Việt