mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 07:52:16 +00:00
Changed the logic to send messages via email
This commit is contained in:
@@ -23,6 +23,9 @@ class ViewMessage extends CI_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loading config file message
|
||||
$this->config->load('message');
|
||||
|
||||
// Load model MessageToken_model
|
||||
$this->load->model('system/MessageToken_model', 'MessageTokenModel');
|
||||
}
|
||||
@@ -39,7 +42,8 @@ class ViewMessage extends CI_Controller
|
||||
if (is_array($msg->retval) && count($msg->retval) > 0)
|
||||
{
|
||||
$data = array (
|
||||
'message' => $msg->retval[0]
|
||||
'message' => $msg->retval[0],
|
||||
'href' => $this->ci->config->item('message_html_view_url')
|
||||
);
|
||||
|
||||
$this->load->view('system/messageHTML.php', $data);
|
||||
|
||||
@@ -287,7 +287,7 @@ class MessageLib
|
||||
* @param integer $priority
|
||||
* @return array
|
||||
*/
|
||||
public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true)
|
||||
public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
@@ -437,13 +437,14 @@ class MessageLib
|
||||
// If the person has an email account
|
||||
if (!is_null($result->retval[$i]->receiver) && $result->retval[$i]->receiver != '')
|
||||
{
|
||||
$href = APP_ROOT . $this->ci->config->item('redirect_view_message_url') . $result->retval[$i]->token;
|
||||
$href = APP_ROOT . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'src' => APP_ROOT . $this->ci->config->item('message_html_view_url') . $result->retval[$i]->token,
|
||||
'href' => $href
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
@@ -456,7 +457,9 @@ class MessageLib
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
@@ -569,12 +572,13 @@ class MessageLib
|
||||
if ($multiPartMime === true)
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$href = APP_ROOT . $this->ci->config->item('redirect_view_message_url') . $result->retval[0]->token;
|
||||
$href = APP_ROOT . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
$bodyMsg = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'src' => APP_ROOT . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token,
|
||||
'href' => $href
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
@@ -588,7 +592,9 @@ class MessageLib
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
@@ -3,4 +3,7 @@
|
||||
</div>
|
||||
<div>
|
||||
B: <?php echo $message->body; ?>
|
||||
</div>
|
||||
<div>
|
||||
<a href="<?php echo $href.$message->token; ?>">Reply</a>
|
||||
</div>
|
||||
@@ -3,17 +3,10 @@
|
||||
<title>This is not the email template, this is a tribute</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
This is the header!
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="body">
|
||||
<iframe width="100%" frameborder="0" src="{src}"></iframe>
|
||||
<a href="{href}">Click here!!!</a>
|
||||
<a href="{href}">Click here to see the message</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
This is the footer!
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1,3 @@
|
||||
Click here!!!! >>>> {href} <<<<<
|
||||
Follow the following link to read the message.
|
||||
|
||||
{href}
|
||||
Reference in New Issue
Block a user