VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: edukas on July 21, 2012, 09:53:58 AM

Title: Send user registration activation email after payment confirmed
Post by: edukas on July 21, 2012, 09:53:58 AM
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?
Title: Re: Send user registration activation email after payment confirmed
Post by: ivus on July 21, 2012, 10:15:50 AM
Hi edukas,

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

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.
Title: Re: Send user registration activation email after payment confirmed
Post by: Milbo on July 23, 2012, 14:46:34 PM
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.