From 4999652643b8744baccce6a1f3b85e3b0f147f7f Mon Sep 17 00:00:00 2001 From: Deepa Gawade Date: Mon, 1 Mar 2021 12:24:43 +0530 Subject: [PATCH 1/2] Task #168285 chore: CSVImport Sending Email on basis of notify user value --- src/com_tjvendors/site/helpers/mails.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/com_tjvendors/site/helpers/mails.php b/src/com_tjvendors/site/helpers/mails.php index d2dca577..3e7e9bd5 100644 --- a/src/com_tjvendors/site/helpers/mails.php +++ b/src/com_tjvendors/site/helpers/mails.php @@ -128,11 +128,14 @@ public function onAfterVendorCreate($vendorDetails) $options = new Registry; $options->set('info', $vendorDetails); - // Mail to site admin - $this->tjnotifications->send($this->client, $adminkey, $adminRecipients, $replacements, $options); + 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 +199,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 +225,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; From 98c99be6ec2a5b16ebc6807860acfa3fe2de77d7 Mon Sep 17 00:00:00 2001 From: Deepa Gawade Date: Mon, 1 Mar 2021 12:38:53 +0530 Subject: [PATCH 2/2] Task #168285 chore: CSVImport Sending Email on basis of notify user value --- src/com_tjvendors/site/helpers/mails.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com_tjvendors/site/helpers/mails.php b/src/com_tjvendors/site/helpers/mails.php index 3e7e9bd5..1bf5604a 100644 --- a/src/com_tjvendors/site/helpers/mails.php +++ b/src/com_tjvendors/site/helpers/mails.php @@ -128,6 +128,7 @@ public function onAfterVendorCreate($vendorDetails) $options = new Registry; $options->set('info', $vendorDetails); + // Added this for Import case if ((isset($vendorDetails->notify_user) && $vendorDetails->notify_user == '1') || (!isset($vendorDetails->notify_user))) { // Mail to site admin