static function sendEmail(&$msgobj, &$config, $to_email, $msg_type, &$messg_model = null) { //$messg_model =& $this->getModel('Message'); JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'tables'); $msg_id = $messg_model->getMsgID($msg_type); $msg = $messg_model->getMsg($msg_id); $from = $config->reply_to; $fromname = $config->organisation; $subject = str_replace('[jobtitle]', $msgobj->title, $msg->subject); $subject = str_replace('[jobid]', $msgobj->job_id, $subject); $subject = str_replace('[toname]', $msgobj->first_name, $subject); $subject = str_replace('[tosurname]', $msgobj->last_name, $subject); $subject = str_replace('[fromname]', $fromname, $subject); $body = str_replace('[jobid]', $msgobj->job_id, $msg->body); $body = str_replace('[jobtitle]', $msgobj->title, $body); $body = str_replace('[toname]', $msgobj->first_name, $body); $body = str_replace('[tosurname]', $msgobj->last_name, $body); $body = str_replace('[fromname]', $fromname, $body); if ($msg_type == 'adminupdate_application') { $status_tbl =& JTable::getInstance('Status', 'Table'); $status_tbl->load($msgobj->status); $user =& JFactory::getUser(); $body = str_replace('[appladmin]', $user->name, $body); $body = str_replace('[department]', $msgobj->dept_name, $body); $body = str_replace('[applstatus]', $status_tbl->status_description, $body); } return JobBoardHelper::dispatchEmail($from, $fromname, $to_email, $subject, $body); }
function sendAdminEmail($dept_name, $type, &$recipients, &$application, $id = 0, $config, $cvattachment = null) { $messg_model =& $this->getModel('Message'); $msg_id = $messg_model->getMsgID($type); $msg = $messg_model->getMsg($msg_id); $from = $config->reply_to; $fromname = $config->organisation; $job_model =& $this->getModel('Job'); $job = $job_model->getJobdata($id); $job->city = $config->use_location == 1 ? $job->city : ''; $subject = $msg->subject; $body = $msg->body; $subject = str_replace('[applstatus]', JText::_('COM_JOBBOARD_ENT_NEW'), $subject); $subject = str_replace('[applname]', $application['name'], $subject); $subject = str_replace('[applsurname]', '', $subject); $subject = str_replace('[fromname]', $fromname, $subject); $subject = str_replace('[jobtitle]', $job->job_title, $subject); $subject = str_replace('[appltitle]', $application['title'], $subject); $subject = str_replace('[location]', $job->city, $subject); $subject = str_replace('[jobid]', $id, $subject); $subject = str_replace('[department]', $dept_name, $subject); $subject = str_replace('[appladmin]', $application['name'], $subject); /* applicant in this case */ $body = str_replace('[applstatus]', JText::_('COM_JOBBOARD_ENT_NEW'), $body); $body = str_replace('[applname]', $application['name'], $body); $body = str_replace('[applsurname]', '', $body); $body = str_replace('[fromname]', $fromname, $body); $body = str_replace('[jobtitle]', $job->job_title, $body); $body = str_replace('[appltitle]', $application['title'], $body); $body = str_replace('[applcovernote]', $application['cover_note'], $body); $body = str_replace('[location]', $job->city, $body); $body = str_replace('[jobid]', $id, $body); $body = str_replace('[department]', $dept_name, $body); $body = str_replace('[appladmin]', $application['name'], $body); /* applicant in this case */ return JobBoardHelper::dispatchEmail($from, $fromname, $recipients, $subject, $body, $cvattachment); }
function sendEmail($msgobj, $config, $to_email, $msg_type) { $messg_model =& $this->getModel('Message'); $msg_id = $messg_model->getMsgID($msg_type); $msg = $messg_model->getMsg($msg_id); $from = $config->reply_to; $fromname = $config->organisation; /* $to_email = $msgobj->email;*/ $job_status = $msgobj->published == 1 ? JText::_('COM_JOBBOARD_ACTIVE') : JText::_('COM_JOBBOARD_INACT'); $subject = str_replace('[jobtitle]', $msgobj->job_title, $msg->subject); $subject = str_replace('[jobid]', $msgobj->id, $subject); $subject = str_replace('[location]', $msgobj->city, $subject); $subject = str_replace('[department]', $msgobj->dept_name, $subject); $subject = str_replace('[status]', $job_status, $subject); $body = str_replace('[jobid]', $msgobj->id, $msg->body); $body = str_replace('[jobtitle]', $msgobj->job_title, $body); $body = str_replace('[location]', $msgobj->city, $body); $body = str_replace('[department]', $msgobj->dept_name, $body); $body = str_replace('[status]', $job_status, $body); if ($msg_type == 'adminupdate' || ($msg_type = 'adminnew')) { $user =& JFactory::getUser(); $body = str_replace('[appladmin]', $user->name, $body); } return JobBoardHelper::dispatchEmail($from, $fromname, $to_email, $subject, $body); }
function sendEmail($msgobj, $recipient) { $messg_model =& $this->getModel('Message'); $msg_id = $messg_model->getMsgID('sharejpriv'); $msg = $messg_model->getMsg($msg_id); $from = $msgobj->sender_email; $fromname = $msgobj->sender_name; $to_email = $recipient; $subject = $msg->subject; $body = $msgobj->personal_message; $body_b = str_replace('[location]', $msgobj->job_city, $msg->body); $body_b = str_replace('[jobtitle]', $msgobj->job_title, $body_b); $body = $body . $body_b . JText::_('MESSAGE_LINK_TEXT') . ': ' . $msgobj->link; return JobBoardHelper::dispatchEmail($from, $fromname, $to_email, $subject, $body); }
function sendEmail($msgobj, $config, $to_email, $msg_type) { $messg_model =& $this->getModel('Message'); $msg_id = $messg_model->getMsgID($msg_type); $msg = $messg_model->getMsg($msg_id); $from = $config->reply_to; $fromname = $config->organisation; $subject = str_replace('[toname]', $msgobj['first_name'], $msg->subject); $subject = str_replace('[tosurname]', $msgobj['last_name'], $subject); $body = str_replace('[toname]', $msgobj['first_name'], $msg->body); $body = str_replace('[tosurname]', $msgobj['last_name'], $body); $user =& JFactory::getUser(); $body = str_replace('[appladmin]', $user->name, $body); if ($msg_type == 'adminnew_application') { $subject = str_replace('[jobtitle]', $msgobj['title'], $subject); $subject = str_replace('[jobid]', $msgobj['job_id'], $subject); $subject = str_replace('[fromname]', $fromname, $subject); $body = str_replace('[jobid]', $msgobj['job_id'], $body); $body = str_replace('[jobtitle]', $msgobj['title'], $body); $body = str_replace('[fromname]', $fromname, $body); $status_tbl =& JTable::getInstance('Status', 'Table'); $status_tbl->load($msgobj['status']); $body = str_replace('[department]', $msgobj['dept_name'], $body); $body = str_replace('[applstatus]', $status_tbl->status_description, $body); } if ($msg_type == 'adminupdate_unsolicited') { $body = str_replace('[applicantid]', $msgobj['id'], $body); } return JobBoardHelper::dispatchEmail($from, $fromname, $to_email, $subject, $body); }