]> git.mxchange.org Git - friendica.git/commitdiff
forgot to check this in earlier... splits up text and html into two different templat...
authorChris Case <kahotep@bunda.dreamhost.com>
Wed, 16 Feb 2011 16:05:10 +0000 (08:05 -0800)
committerChris Case <kahotep@bunda.dreamhost.com>
Wed, 16 Feb 2011 16:05:10 +0000 (08:05 -0800)
mod/dfrn_notify.php

index 5f91f1b1be33de4d5085d350e813dd2c763a24d8..040263b0ca8ecbb23273fe9ffd6fd31dc487e797 100644 (file)
@@ -210,10 +210,23 @@ function dfrn_notify_post(&$a) {
                                = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "<br />\n",$msg['body']))));
                        
                        // load the template for private message notifications
-                       $tpl = load_view_file('view/mail_received_eml.tpl');
+                       $tpl = load_view_file('view/mail_received_html_body_eml.tpl');
+                       $email_html_body_tpl = replace_macros($tpl,array(
+                               '$siteName'             => $a->config['sitename'],                              // name of this site
+                               '$siteurl'              => $a->get_baseurl(),                                   // descriptive url of this site
+                               '$thumb'                => $importer['thumb'],                                  // thumbnail url for sender icon
+                               '$email'                => $importer['email'],                                  // email address to send to
+                               '$url'                  => $importer['url'],                                    // full url for the site
+                               '$from'                 => $msg['from-name'],                                   // name of the person sending the message
+                               '$title'                => stripslashes($msg['title']),                 // subject of the message
+                               '$htmlversion'  => $msg['htmlversion'],                                 // html version of the message
+                               '$mimeboundary' => $msg['mimeboundary'],                                // mime message divider
+                               '$hostname'             => $a->get_hostname()                                   // name of this host
+                       ));
                        
-                       // import the data into the template                    
-                       $email_tpl = replace_macros($tpl, array(
+                       // load the template for private message notifications
+                       $tpl = load_view_file('view/mail_received_text_body_eml.tpl');
+                       $email_text_body_tpl = replace_macros($tpl,array(
                                '$siteName'             => $a->config['sitename'],                              // name of this site
                                '$siteurl'              => $a->get_baseurl(),                                   // descriptive url of this site
                                '$thumb'                => $importer['thumb'],                                  // thumbnail url for sender icon
@@ -222,11 +235,24 @@ function dfrn_notify_post(&$a) {
                                '$from'                 => $msg['from-name'],                                   // name of the person sending the message
                                '$title'                => stripslashes($msg['title']),                 // subject of the message
                                '$textversion'  => $msg['textversion'],                                 // text version of the message
-                               '$htmlversion'  => $msg['htmlversion'],                                 // html version of the message
                                '$mimeboundary' => $msg['mimeboundary'],                                // mime message divider
                                '$hostname'             => $a->get_hostname()                                   // name of this host
                        ));
                        
+                       // load the template for private message notifications
+                       $tpl = load_view_file('view/mail_received_eml.tpl');
+                       
+                       // import the data into the template                    
+                       $email_tpl = replace_macros($tpl, array(
+                               '$email'                => $importer['email'],                                  // email address to send to
+                               '$from'                 => $msg['from-name'],                                   // name of the person sending the message
+                               '$title'                => stripslashes($msg['title']),                 // subject of the message
+                               '$mimeboundary' => $msg['mimeboundary'],                                // mime message divider
+                               '$hostname'             => $a->get_hostname(),                                  // name of this host
+                               '$htmlbody'             => chunk_split(base64_encode($email_html_body_tpl)),
+                               '$textbody'             => chunk_split(base64_encode($email_text_body_tpl))
+                       ));
+                       
                        logger("message headers: " . $msg['headers']);
                        logger("message body: " . $mail_tpl);