VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Twototango on December 06, 2018, 13:17:43 PM

Title: How to disable registration mail?
Post by: Twototango on December 06, 2018, 13:17:43 PM
I want to stop VM sending out the registration mail to new users.

Registration mail to shop owner is ok
But do not want new users to receive this.

How do I go about this, can't see an option for it in VM (3.4.2)

Thanks for replying
Title: Re: How to disable registration mail?
Post by: GJC Web Design on December 06, 2018, 15:35:03 PM
Hi  Jack,

it is hardcoded in the administrator\components\com_virtuemart\models\user.php ->  private function sendRegistrationEmail($user,$password, $useractivation);

you could adapt it there  - a switch in admin could be nice though
Title: Re: How to disable registration mail?
Post by: Twototango on December 10, 2018, 11:03:31 AM
Thanks John, I should be able to find that ;-)

I agree... shop owners should have control over what is, and isn't, send to their customers.
A switch would be nice.


Title: Re: How to disable registration mail?
Post by: Guntchaa on April 26, 2020, 21:35:56 PM
Guys, my expertise in php is very weak, may be you can post here code snippet for canceling sending registration information to shopper?
This will be very helpful for me and others.
(Yes, i understand, changes will be lost after update ...)
Title: Re: How to disable registration mail?
Post by: GJC Web Design on April 26, 2020, 23:03:11 PM
Haven't tested but probably just comment out the function call

administrator\components\com_virtuemart\models\user.php  ~ line 383

end of the register function


// $this->sendRegistrationEmail($user,$pw, $useractivation);
Title: Re: How to disable registration mail?
Post by: Guntchaa on May 03, 2020, 17:03:56 PM
(J! 3.9.18; VM 3.6.10)
// $this->sendRegistrationEmail($user,$pw, $useractivation);

should be, but not working ... Shopper still receive registration emails ... any other ideas?

I commented out all block (lines 287-398) - the same.
Title: Re: How to disable registration mail?
Post by: Jörgen on May 03, 2020, 17:21:43 PM
Using overrides in your template?
May also search for the function Call in all your Joomla files.
Jörgen @ Kreativ Fotografi
Title: Re: How to disable registration mail?
Post by: Guntchaa on May 03, 2020, 18:41:04 PM
As i see, generally the solution mentioned there before - works.

As I see, my problem is located in plg_VPOnePageCheckout_VM3-6.8.zip.
When VPOPC is disabled, shopper do not receive registration email.

But, as i see, vpopc is written in JS, i have no idea how to deal with this.
Title: Re: How to disable registration mail?
Post by: pinochico on May 03, 2020, 18:49:44 PM
Then you can try another forum, especially for VPOnePageCheckout
Title: Re: How to disable registration mail?
Post by: jenkinhill on May 04, 2020, 11:57:41 AM
VP support forum is https://www.virtueplanet.com/forum/
Title: Re: How to disable registration mail?
Post by: Guntchaa on May 04, 2020, 19:19:49 PM
The correct solution is (thank you to Jumbo from VP forum):
components/com_virtuemart/helpers/shopfunctionsf.php
static public function renderMail ($viewName, $recipient, $vars = array(), $controllerName = NULL, $noVendorMail = FALSE,$useDefault=true)

replace
$user = self::sendVmMail( $view, $recipient, $noVendorMail );

with
// Do not send registration mails to users
if($viewName != 'user') {
$user = self::sendVmMail( $view, $recipient, $noVendorMail );
}
Title: Re: How to disable registration mail?
Post by: pinochico on May 04, 2020, 19:33:46 PM
I don't understand why when I buy on the e-shop, I don't get my account information so that I can't log in next time (I don't know my username and password).

Is this a requirement?

Remember that this hack will disappear the next time you upgrade VirtueMart.