CMS MADE SIMPLE FORGE

FrontendUser Mailer

 

[#9282] Supporting alternative text body when sending html mails.

avatar
Created By: Virgo Pärna (virgo)
Date Submitted: 2013-05-28 08:31

Assigned To:
Resolution: None
State: Open
Summary:
Supporting alternative text body when sending html mails.
Detailed Description:
FEU Mailer is lacking one feaeture, when sending html e-mails.
Righ now I created primitive version, that creates AltBody with strip_tags().

Patch to 0.9.4 is below.

 branches/0.9.x/action.prepareSendMail.php | 4 ++++
 branches/0.9.x/action.sendMail.php        | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/branches/0.9.x/action.prepareSendMail.php
b/branches/0.9.x/action.prepareSendMail.php
index fe777b2..3a20889 100644
--- a/branches/0.9.x/action.prepareSendMail.php
+++ b/branches/0.9.x/action.prepareSendMail.php
@@ -256,6 +256,10 @@ if($mail_type=='archive') {
 					$cmsmailer->AddAddress($data['email']);
 					$cmsmailer->SetBody($mail_content);
 					$cmsmailer->IsHTML($this->GetPreference('is_html',false));
+					if ($this->GetPreference('is_html',false)) {
+						$cmsmailer->SetAltBody(strip_tags($mail_content));
+					}
+
 					$cmsmailer->SetSubject($subject);
 					$cmsmailer->Send();
 					$cmsmailer->ClearAddresses();
diff --git a/branches/0.9.x/action.sendMail.php
b/branches/0.9.x/action.sendMail.php
index 0170db6..dbd5306 100644
--- a/branches/0.9.x/action.sendMail.php
+++ b/branches/0.9.x/action.sendMail.php
@@ -246,6 +246,9 @@ foreach($recipients as $userid=>$data) {
 		$cmsmailer->AddAddress($data['email']);
 		$cmsmailer->SetBody($mail_content);
 		$cmsmailer->IsHTML($prefs['is_html']);
+		if ($prefs['is_html']) {
+			$cmsmailer->SetAltBody(strip_tags($mail_content));
+		}
 		$cmsmailer->SetSubject($subject);
 		$cmsmailer->Send();
 		$cmsmailer->ClearAddresses();
 

History