summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-19 10:20:54 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-19 10:20:54 +0200
commit8df1ae2d7e0fd441f7a1fc481c76c5c1edfadf23 (patch)
treef8728d0e023961199814890d41bd35827f19614b /system/libraries/Email.php
parent925dd9030db7a5a47d8a79f94b35827b14b9b685 (diff)
Fix another mailing issue (based on #1281)
Diffstat (limited to 'system/libraries/Email.php')
-rw-r--r--system/libraries/Email.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 795db2043..c1130e915 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -742,8 +742,8 @@ class CI_Email {
/**
* Build alternative plain text message
*
- * This public function provides the raw message for use
- * in plain-text headers of HTML-formatted emails.
+ * Provides the raw message for use in plain-text headers of
+ * HTML-formatted emails.
* If the user hasn't specified his own alternative message
* it creates one by stripping the HTML
*
@@ -751,9 +751,11 @@ class CI_Email {
*/
protected function _get_alt_message()
{
- if ($this->alt_message !== '')
+ if ( ! empty($this->alt_message))
{
- return $this->word_wrap($this->alt_message, 76);
+ return ($this->wordwrap)
+ ? $this->word_wrap($this->alt_message, 76)
+ : $this->alt_message;
}
$body = preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match) ? $match[1] : $this->_body;
@@ -764,7 +766,9 @@ class CI_Email {
$body = str_replace(str_repeat("\n", $i), "\n\n", $body);
}
- return $this->word_wrap($body, 76);
+ return ($this->wordwrap)
+ ? $this->word_wrap($body, 76)
+ : $body;
}
// --------------------------------------------------------------------
@@ -773,7 +777,7 @@ class CI_Email {
* Word Wrap
*
* @param string
- * @param int
+ * @param int line-length limit
* @return string
*/
public function word_wrap($str, $charlim = NULL)