mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
Messaging Mail Template can be overwritten in the Database
This commit is contained in:
@@ -427,31 +427,67 @@ class MessageLib
|
||||
|| (!is_null($result->retval[$i]->employeecontact) && $result->retval[$i]->employeecontact != ''))
|
||||
{
|
||||
$href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[$i]->token;
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML');
|
||||
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($body) || $body == '')
|
||||
{
|
||||
$this->ci->loglib->logError('Error while parsing the mail template');
|
||||
}
|
||||
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailTXT');
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($altBody) || $altBody == '')
|
||||
{
|
||||
$this->ci->loglib->logError('Error while parsing the mail template');
|
||||
@@ -571,15 +607,32 @@ class MessageLib
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[0]->token;
|
||||
$bodyMsg = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML');
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
$bodyMsg = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$bodyMsg = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($bodyMsg) || $bodyMsg == '')
|
||||
{
|
||||
// $body = $result->retval[0]->body;
|
||||
@@ -587,15 +640,31 @@ class MessageLib
|
||||
}
|
||||
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML');
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
$altBody = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($altBody) || $altBody == '')
|
||||
{
|
||||
$this->ci->loglib->logError('Error while parsing the plain text mail template');
|
||||
|
||||
Reference in New Issue
Block a user