mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
using json to load the mail allows to place everything message related in the view (e.g. the subject)
This commit is contained in:
@@ -374,8 +374,8 @@ class Options extends CI_Controller {
|
||||
|
||||
$this->email->from($this->optionslib->get_option('emailAddress'), $this->optionslib->get_option('emailSenderName'));
|
||||
$this->email->to($email);
|
||||
$this->email->subject('Wavelog Test-Mail');
|
||||
$this->email->message($message);
|
||||
$this->email->subject($message['subject']);
|
||||
$this->email->message($message['body']);
|
||||
|
||||
if (! $this->email->send()){
|
||||
$this->session->set_flashdata('testmailFailed', __("Testmail failed. Something went wrong."));
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?=
|
||||
<?php
|
||||
|
||||
__("Hi,
|
||||
$message['subject'] = __("Wavelog Test-Mail");
|
||||
|
||||
$message['body'] = __("Hi,
|
||||
|
||||
This is a test email from your Wavelog instance.
|
||||
|
||||
@@ -9,3 +11,5 @@ If you received this email, your mail settings are correct.
|
||||
Regards,
|
||||
|
||||
Wavelog");
|
||||
|
||||
echo json_encode($message);
|
||||
@@ -469,7 +469,7 @@ class CI_Email {
|
||||
* @param array $data = array()
|
||||
* @param string language
|
||||
*
|
||||
* @return string message
|
||||
* @return string message in json format
|
||||
*/
|
||||
|
||||
public function load($view, $data = array(), $language = NULL) {
|
||||
@@ -492,7 +492,7 @@ class CI_Email {
|
||||
_setlocale(LC_ALL, $origin_lang);
|
||||
}
|
||||
|
||||
return html_entity_decode($message);
|
||||
return json_decode(html_entity_decode($message), true);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user