Лучший Ответ Cheren-dow , 28 October 2014 - 12:05
An1hony , доброго времени суток. Из полученного материала можно получить id приложения следующим образом
$item->application_id;
Ну и кусок кода
if ($state) {
$item = $this->table->get($id);
$mailer = JFactory::getMailer();
$user = JFactory::getUser($item->created_by);
$config = JFactory::getConfig();
$sender = array($config->get('mailfrom'), $config->get('fromname'));
$mailer->setSender($sender);
$mailer->addRecipient($user->email);
$body = $user->name . ', ваш объект «' . $item->name . '» одобрен. Теперь вы можете увидеть его в списках на сайте.';
$mailer->setSubject('Your subject string');
$mailer->setBody($body);
$send = $mailer->Send();
}
Можно заменить на
if ($state) {
$item = $this->table->get($id);
if ($item->application_id == 11) { // указать id нужного приложения
$mailer = JFactory::getMailer();
$user = JFactory::getUser($item->created_by);
$config = JFactory::getConfig();
$sender = array($config->get('mailfrom'), $config->get('fromname'));
$mailer->setSender($sender);
$mailer->addRecipient($user->email);
$body = $user->name . ', ваш объект «' . $item->name . '» одобрен. Теперь вы можете увидеть его в списках на сайте.';
$mailer->setSubject('Your subject string');
$mailer->setBody($body);
$send = $mailer->Send();
}
}
Перейти к сообщению


Тема закрыта








