[Rt-commit] rt branch, plaintext-dashboards, updated. rt-3.9.6-39-gc6ab333

Shawn Moore sartak at bestpractical.com
Wed Dec 1 14:55:38 EST 2010


The branch, plaintext-dashboards has been updated
       via  c6ab3331947a3a38af4acbf77080c6ba26ae5d25 (commit)
      from  234b138056def42653b7e1cc5fa1fd108e9431cc (commit)

Summary of changes:
 sbin/rt-email-dashboards.in |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit c6ab3331947a3a38af4acbf77080c6ba26ae5d25
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Dec 1 14:55:21 2010 -0500

    First pass at adding plaintext to dashboards

diff --git a/sbin/rt-email-dashboards.in b/sbin/rt-email-dashboards.in
index 1f89df4..0e17dbb 100644
--- a/sbin/rt-email-dashboards.in
+++ b/sbin/rt-email-dashboards.in
@@ -349,14 +349,30 @@ sub build_email {
         Type    => "multipart/mixed",
     );
 
-    $entity->attach(
+    # In general, user agents that compose "multipart/alternative" entities
+    # must place the body parts in increasing order of preference, that is,
+    # with the preferred format last. - RFC2046
+
+    my $body = MIME::Entity->build(
+        Type => "multipart/alternative",
+    );
+
+    my $text = RT::Interface::Email::ConvertHTMLToText($content);
+    $body->add_part(
+        Data        => Encode::encode_utf8($text),
+        Type        => 'text/plain',
+        Charset     => 'UTF-8',
+        Disposition => 'inline',
+    );
+
+    $body->add_part(
         Data        => Encode::encode_utf8($content),
         Type        => 'text/html',
         Charset     => 'UTF-8',
         Disposition => 'inline',
     );
 
-    for my $part (@parts) {
+    for my $part ($body, @parts) {
         $entity->add_part($part);
     }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list