Pgehres has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/55293


Change subject: Adding support for html2text to the TY email generator.
......................................................................

Adding support for html2text to the TY email generator.

Change-Id: Icdefadb7a1f6ce8e237c8680cfc3bfa89689d9e2
---
M sites/all/modules/thank_you/make_thank_you.php
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm 
refs/changes/93/55293/1

diff --git a/sites/all/modules/thank_you/make_thank_you.php 
b/sites/all/modules/thank_you/make_thank_you.php
index bdc7d8b..fc8a06f 100644
--- a/sites/all/modules/thank_you/make_thank_you.php
+++ b/sites/all/modules/thank_you/make_thank_you.php
@@ -14,6 +14,8 @@
  *                                                                    *
  **********************************************************************/
 
+require_once 'html2text.php';
+
 $valid_translation_states = array(
        'ready',
        'proofread',
@@ -280,6 +282,19 @@
 
 /**
  *
+ * @param $htmlfilename
+ * @param $outfilename
+ */
+function generate_txt_2012( $htmlfilename, $outfilename ) {
+
+       $html = new html2text( $htmlfilename, true );
+       $outfile = fopen( $outfilename, 'w' );
+       fwrite( $outfile, $html->get_text() );
+       fclose( $outfile );
+}
+
+/**
+ *
  */
 
 $titles = array(
@@ -302,6 +317,7 @@
                if ( check_translation( $json ) ){
                        add_helper_keys( $json );
                        generate_html_2012( $l, $json, 
"templates/html/thank_you.$l.html" );
+                       generate_txt_2012( "templates/html/thank_you.$l.html", 
"templates/txt/thank_you.$l.txt" );
                        linewrap( "templates/html/thank_you.$l.html", 90 );
                }
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/55293
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdefadb7a1f6ce8e237c8680cfc3bfa89689d9e2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/civicrm
Gerrit-Branch: master
Gerrit-Owner: Pgehres <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to