Send user registration activation email after payment confirmed

Started by edukas, July 21, 2012, 09:53:58 AM

Previous topic - Next topic

edukas

Hi everyone

I'm trying to slightly alter the timing of when the user registration activation email is sent.
At the moment in the stock-standard VM, a newly registering user is sent the "Please use this link to activate your account" email when they enter in their details for an order, before the order is confirmed.

I'm wanting to make this email be sent once payment has been confirmed.
It seems simple enough, i just need to run the appropriate function in plgVmOnPaymentNotification(), with that function being sendRegistrationEmail() (found in /administrator/components/com_virtuemart/models/user.php)

At the moment sendRegistrationEmail() is run when the user's data is saved to the database. I'd obviously just have to stop this from being run.

I've tried adding sendRegistrationEmail() to plgVmOnPaymentNotification() but it doesn't run.

any suggestions?

ivus

Hi edukas,

Seems simple enough to achieve, but (always a but right?) here are some ramifications from changing the process, perhaps something to consider:

       
  • Stopping it from sending the registration email will be a site wide change as you're altering Joomla! core functions not just VM.
  • If a user registers, but does not finish their cart process, they will not be able to re-register because their details have already been captured on your system and the username/email combo reserved... and trust me people get very annoyed when this type of stuff happens.
  • Depending on your payment plugin/options, not all orders are instantly given the CONFIRMED status which means your event won't trigger.

Quote
   I've tried adding sendRegistrationEmail() to plgVmOnPaymentNotification() but it doesn't run.

Did you include all the parameters that function requires?



private function sendRegistrationEmail($user, $password, $doUserActivation){}



I hope this helps.

Milbo

Correct Ivus

and consider also what it should bring that people can register without confirmation and buy. I advise not to use the double optin. Why do you want that your shopper is doing an extra step? You lose more customers than having problems with spammers, believe me.

I would just disable it in joomla and activate that only people who bought this product are allowed to write a review and then your are fine.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/