Author Topic: How To Change Who Recieves Order Notification Emails?  (Read 15651 times)

woood77

  • Beginner
  • *
  • Posts: 26
How To Change Who Recieves Order Notification Emails?
« on: May 08, 2012, 18:48:46 pm »
Hello,

I pulling my hair out trying to figure out how to change where order notification emails are sent to.  Right now they come to the Super Admin account.  I want to change this to one of the Administrators on the site.  How can I do this?

Thank you for the help.

hkymre

  • Guest
Re: How To Change Who Recieves Order Notification Emails?
« Reply #1 on: May 18, 2012, 10:07:34 am »
I've been having similar problems with the emails coming to me instead of the store owner.

I think I've fixed it with phpmyadmin

In the table   `jos_virtuemart_vmusers` the field virtuemart_vendor_id was set to 1 for my user (and most other users)

I've set this to 0 for all users, except for the store owner, and now when I check the shop - /index.php?option=com_virtuemart&view=user&task=editshop the email address listed under additional info is the correct one.

celticwebs

  • Beginner
  • *
  • Posts: 45
Re: How To Change Who Recieves Order Notification Emails?
« Reply #2 on: June 02, 2012, 20:58:25 pm »
I had a similar issue which i fixed in the same way as you did, I just changed who was the vendor and it emailed them correctly. 

Problem I now have is I want to email more than one person with notification of a new order.  Anybody know wher ethe file that sends emails is?  I'll manually edit it to add an extra email into it like we used to have to in VM1.


Anyone got any idea which file it is ?

Thomas Kuschel

  • Jr. Member
  • **
  • Posts: 81
    • LOYTEC electronics GmbH
Re: How To Change Who Recieves Order Notification Emails?
« Reply #3 on: June 02, 2012, 21:53:09 pm »
Hi ceticwebs,

I've added some stuff to the mailing (see http://forum.virtuemart.net/index.php?topic=100367.0 )
add "vendor" addresses - hack with e.g. myemailaddress1@example.com, myemailaddress2@example.com,... to the
shopfunctionsf.php: - it is _really_ a hack and awful ;-)

Code: [Select]
/**
* With this function you can use a view to sent it by email.
* Just use a task in a controller todo the rendering of the email.
*
* @param string $view for example user, cart
* @param string $recipient shopper@whatever.com
* @param bool $vendor true for notifying vendor of user action (e.g. registration)
* @return true if successful
*/
private function sendVmMail (&$view, $recipient, $vendor=false ) {
$jlang =JFactory::getLanguage();
if(VmConfig::get('enableEnglish', 1)){
$jlang->load('com_virtuemart', JPATH_SITE, 'en-GB', true);
}
$jlang->load('com_virtuemart', JPATH_SITE, $jlang->getDefault(), true);
$jlang->load('com_virtuemart', JPATH_SITE, null, true);

ob_start();
$view->renderMailLayout($vendor, $recipient);
$body = ob_get_contents();
ob_end_clean();

$subject = (isset($view->subject)) ? $view->subject : JText::_('COM_VIRTUEMART_DEFAULT_MESSAGE_SUBJECT');
$mailer = JFactory::getMailer();
$mailer->addRecipient($recipient);
$mailer->setSubject($subject);
$mailer->isHTML(VmConfig::get('order_mail_html',true));
$mailer->setBody($body);

$mailfrom = array();
if($vendor){   //this is the mail to the vendor!

$mailer->addRecipient('myemailaddress1@example.com');
$mailer->addRecipient('myemailaddress2@example.com');

$mail_from_recipient = VmConfig::get('mail_from_recipient','0');
if ($mail_from_recipient =='1'){
if(isset($view->user)){
$mailfrom[0] = $view->user['email'];
$mailfrom[1] = $view->user['name'];
}else{
$user = JFactory::getUser(); //fallback
if (!empty($user->id)) {
$mailfrom[0] = $user->email;
$mailfrom[1] = $user->name;
}
}
} //else fetch the Joomla setup email address
}else{
$mailfrom[0]=$view->vendorEmail;
$mailfrom[1]= $view->vendor->vendor_name;
}
if(!empty($mailfrom)){
$mail_from_setSender = VmConfig::get('mail_from_setsender','0');
if ($mail_from_setSender=='0') {
$mailer->addReplyTo($mailfrom);
}else {
$mailer->setSender($mailfrom);
}
}

if (isset($view->mediaToSend)) {
foreach ((array)$view->mediaToSend as $media) {
//Todo test and such things.
$mailer->addAttachment($media);
}
}

return $mailer->Send();
}

not tested, but it should work. (hope there's no typo)

Thomas

celticwebs

  • Beginner
  • *
  • Posts: 45
Re: How To Change Who Recieves Order Notification Emails?
« Reply #4 on: June 06, 2012, 15:59:05 pm »
Hi Thomas,

Thanks for the reply and apologies for the delayed reply, I keep forgetting to click notify!  I'll have to go set it as default so I get notifications, I bet lots of posts go dead because the poster didn't realise a post had been replied to.

With the above function, do I just add it to functions.php in admin and change the emails to the ones I want to receive order emails?

celticwebs

  • Beginner
  • *
  • Posts: 45
Re: How To Change Who Recieves Order Notification Emails?
« Reply #5 on: June 06, 2012, 16:03:49 pm »
Ooops!  I misse dteh f, no wonder I couldn’t find the function!  It's in the site side files not the admin ones :)

I just updated the fucntion with your setup, about to test it :)

***UPDATE***

It worked perfectly :)

thanks Thomas!

Thomas Kuschel

  • Jr. Member
  • **
  • Posts: 81
    • LOYTEC electronics GmbH
Re: How To Change Who Recieves Order Notification Emails?
« Reply #6 on: June 06, 2012, 19:46:08 pm »
Oh yes, mind the "f" :-). It's the file components/com_virtuemart/helpers/shopfunctionsf.php
You are welcome, ceticwebs.
Thomas

Merry

  • Jr. Member
  • **
  • Posts: 83
  • When life hands you lemons, grab tequila and salt.
    • ShowMeGuides
Re: How To Change Who Recieves Order Notification Emails?
« Reply #7 on: June 06, 2012, 21:45:59 pm »
Hello,

I pulling my hair out trying to figure out how to change where order notification emails are sent to.  Right now they come to the Super Admin account.  I want to change this to one of the Administrators on the site.  How can I do this?

Thank you for the help.

There are many ways to do this, but here is the easy way for site administrators using the Admin and your mail host:

1. At the web host (cPanel, Gmail or similar) set up a mail forward named orders@yourdomainname.com and forward to everyone who needs a copy.
2. In JOOMLA (Not VirtueMart) top navigation menu click USERS - User Management - Super User - Account Details - EMAIL and change that email address to orders@yourdomainname.com. Be sure to click top right SAVE Button.

Best regards,
Merry

Answer is probably from my VirtueMart 2 User Manual ebook, includes FREE updates. FREE Admin Menu Cheatsheet, Quick Install Guide & 30-Minute Quick Setup Guide http://showmeguides.com/

celticwebs

  • Beginner
  • *
  • Posts: 45
Re: How To Change Who Recieves Order Notification Emails?
« Reply #8 on: June 06, 2012, 23:24:06 pm »
Hi Merry,

Thanks for the suggestion, I had already tried that one but I actually only wanted orders to be sent to it not all the admin email so that didn't quite work as I wanted.

Thanks again for the suggestion though :)

I don't suppose either of you have any knowledge of the issue I'm having with paypal delivery addresses do you ?  The thread is here http://forum.virtuemart.net/index.php?topic=103513

Thomas Kuschel

  • Jr. Member
  • **
  • Posts: 81
    • LOYTEC electronics GmbH
Re: How To Change Who Recieves Order Notification Emails?
« Reply #9 on: June 07, 2012, 16:14:13 pm »
Hi Merry, thank you for your suggestion too, that's definitely the best way not to change the sources. :D
Regards Thomas
 

Piccoro

  • Beginner
  • *
  • Posts: 5
Re: How To Change Who Recieves Order Notification Emails?
« Reply #10 on: July 09, 2012, 18:54:05 pm »
I've been having similar problems with the emails coming to me instead of the store owner.

I think I've fixed it with phpmyadmin

In the table   `jos_virtuemart_vmusers` the field virtuemart_vendor_id was set to 1 for my user (and most other users)

I've set this to 0 for all users, except for the store owner, and now when I check the shop - /index.php?option=com_virtuemart&view=user&task=editshop the email address listed under additional info is the correct one.

Thank you for this solution.
It solves the multi vendor problem in VM 2 perfectly.

fredonline

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: How To Change Who Recieves Order Notification Emails?
« Reply #11 on: May 22, 2018, 20:09:58 pm »
I've got to say, this is about the worst method I've seen for managing order notification email.

Whose idea was this? To (silently) send orders to the superadmin...with nothing mentioned anywhere about this...and no way to change this?

Horrible!

I would be speechless, except I wasted so much time on this. And my user/store owner (who is NOT the superadmin!!!) is not getting order confirmations.

Who made the assumption that the superadmin that designed the site would be the same as the store owner? How about web designer vs. store owner. NOT THE SAME PERSON!

This is actually inexcusable.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1725
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: How To Change Who Recieves Order Notification Emails?
« Reply #12 on: May 22, 2018, 20:24:47 pm »
Hello Fredonline

Take it down a notch and think before You speak. This is configurable, but I can´t help You much more than this, the batteries in my magic lamp are out. :(

http://forum.virtuemart.net/index.php?topic=79799.0

regards

Jörgen @ Kreativ Fotografi

Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

fredonline

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: How To Change Who Recieves Order Notification Emails?
« Reply #13 on: May 22, 2018, 22:51:11 pm »
Virtuemart 3.2.14 on Joomla 3.8.7, CentOS 7.3, PHP 7.0.30

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26996
  • Always on vacation
    • Jenkin Hill Internet
Re: How To Change Who Recieves Order Notification Emails?
« Reply #14 on: May 22, 2018, 23:39:15 pm »
Fred it is a very simple configuration issue - and always has been. I do wonder, though, why you add your comment to a six year old thread.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12