diff --git a/src/com_tjvendors/site/helpers/mails.php b/src/com_tjvendors/site/helpers/mails.php index d2dca577..1bf5604a 100644 --- a/src/com_tjvendors/site/helpers/mails.php +++ b/src/com_tjvendors/site/helpers/mails.php @@ -128,11 +128,15 @@ public function onAfterVendorCreate($vendorDetails) $options = new Registry; $options->set('info', $vendorDetails); - // Mail to site admin - $this->tjnotifications->send($this->client, $adminkey, $adminRecipients, $replacements, $options); + // Added this for Import case + if ((isset($vendorDetails->notify_user) && $vendorDetails->notify_user == '1') || (!isset($vendorDetails->notify_user))) + { + // Mail to site admin + $this->tjnotifications->send($this->client, $adminkey, $adminRecipients, $replacements, $options); - // Mail to Promoter - $this->tjnotifications->send($this->client, $vendorerkey, $promoterRecipients, $replacements, $options); + // Mail to Promoter + $this->tjnotifications->send($this->client, $vendorerkey, $promoterRecipients, $replacements, $options); + } return; } @@ -196,7 +200,10 @@ public function onAfterVendorEdit($vendorDetails) $replacements->vendor_data = $vendorData; $options->set('vendor_data', $vendorData); - $this->tjnotifications->send($this->client, $approvalkey, $promoterRecipients, $replacements, $options); + if ((isset($vendorDetails->notify_user) && $vendorDetails->notify_user == '1') || (!isset($vendorDetails->notify_user))) + { + $this->tjnotifications->send($this->client, $approvalkey, $promoterRecipients, $replacements, $options); + } } elseif ($vendorDetails->user_id === $loggedInUser) { @@ -219,7 +226,10 @@ public function onAfterVendorEdit($vendorDetails) $adminkey = "editVendorMailToAdmin"; - $this->tjnotifications->send($this->client, $adminkey, $adminRecipients, $replacements, $options); + if ((isset($vendorDetails->notify_user) && $vendorDetails->notify_user == '1') || (!isset($vendorDetails->notify_user))) + { + $this->tjnotifications->send($this->client, $adminkey, $adminRecipients, $replacements, $options); + } } return;