Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import csv email changes #127

Open
wants to merge 2 commits into
base: release-1.4.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/com_tjvendors/site/helpers/mails.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down