Plugin Directory

Changeset 630043


Ignore:
Timestamp:
11/26/2012 10:25:01 AM (13 years ago)
Author:
mightyturtle
Message:

0.6.1 Minor update to fix bugs in purchase receipt emails

Location:
wp-e-commerce-style-email/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-e-commerce-style-email/trunk/mail.class.php

    r619324 r630043  
    450450        if(!empty($message_formatted)) {
    451451            $message=$message_formatted;
    452             //TODO: make sure content-type isn't already specified in the header. Right now, I don't think e-commerce sets a content-type header.
    453             $ecse_charset = get_option('ecse_charset'); //not sure if anyone still uses this. Legacy since fixed charset mangling.
    454             if(empty($ecse_charset)) $ecse_charset = get_bloginfo( 'charset' ); //by default, WP assigns the charset of the blog to the emails. Not sure we need to do this. Not even sure anyone would want to override it.
    455             if(empty($ecse_charset)) $ecse_charset = 'UTF-8';
    456             $headers .= "Content-Type: text/html; charset=".$ecse_charset.";\r\n";
     452            //make sure content-type isn't already specified in the header.
     453            if(stripos('x'.$headers, 'Content-Type: text/html;')==false) {
     454                $ecse_charset = get_option('ecse_charset'); //not sure if anyone still uses this. Legacy since fixed charset mangling.
     455                if(empty($ecse_charset)) $ecse_charset = get_bloginfo( 'charset' ); //by default, WP assigns the charset of the blog to the emails. Not sure we need to do this. Not even sure anyone would want to override it.
     456                if(empty($ecse_charset)) $ecse_charset = 'UTF-8';
     457                $headers .= "\r\nContent-Type: text/html; charset=".$ecse_charset.";\r\n";
     458            }
    457459            if(ecse_is_test_email() || ecse_is_other_email()) { //set the 'from' to be same as WPEC emails. Note that this can still be overridden by plugins and WP itself, like in user registrations.
    458460                $reply_address = get_option( 'return_email' );
     
    480482        $purch_id = intval(preg_replace("/[^0-9]/", '', $report_id));
    481483   
    482         $message = '<!-- !ecse! '.$purch_id.' !ecse! -->'.$message;
     484        $message = '<!-- !ecse! '.$purch_id.' !ecse! --> '.$message;
    483485   
    484486        return $message;
     
    504506    static function strip_pid_tag($message) {
    505507        $pid_start = stripos($message, '<!-- !ecse!');
    506         $pid_end = stripos($message, '!ecse! -->', $pid_start+1) + 9;
     508        $pid_end = stripos($message, '!ecse! -->', $pid_start+1) + 10;
    507509        if(stripos($message, '!ecse! -->')>0) $message = substr_replace($message, '', $pid_start, $pid_end-$pid_start);
    508510        return $message;
  • wp-e-commerce-style-email/trunk/readme.txt

    r619324 r630043  
    44Requires at least: 3.2
    55Tested up to: 3.4.2
    6 Stable tag: 0.6
     6Stable tag: 0.6.1
    77
    88Style the emails that WP e-Commerce sends to your customers.
     
    7979
    8080I think these are helpful references:
     81
    8182http://www.campaignmonitor.com/css/
     83
    8284http://www.htmlgoodies.com/beyond/css/article.php/3679231/How-to-Create-Great-HTML-Emails-with-CSS.htm
     85
    8386http://kb.mailchimp.com/article/how-to-code-html-emails
    8487
     
    9396*   Go to the 'Store Email Style' options page and click to see a browser preview, or have a test styled email sent to you;
    9497*   While you're in testing phase, store emails (including customer receipts) that are sent to an admin email address will automatically be styled, so you can see what actual customers will see before they do.
     98
     99= Why are linebreaks being removed from my product list? =
     100
     101This issue only seems to crop up when you're not templating the receipt content, you're on WPEC pre-3.8.9, and you've got some HTML in the WPEC layout option for that content.
     102
     103Why might it happen? When you turn on this plugin and apply style, the plugin will do its best job to make the plain text content look good in HTML.
     104It does so by converting plain text linebreaks to HTML tags.
     105But the plugin will only do that if it doesn't detect HTML in the content already.
     106
     107So let's say you've put some HTML tags before or after your product list in the WPEC admin settings tab, where you layout the purchase receipt content.
     108My plugin will detect some HTML, and then it won't add any HTML of its own to the content. As a result the plain text linebreaks remain, and they don't mean much in an HTML email.
     109
     110How might you overcome this issue? Try removing the HTML from the WPEC content. Or even better, use the content templating that this plugin enables.
     111It's easy (you can copy sample templates from this plugin's folder) and your receipts will look better anyway.
     112
     113This is only an issue before WPEC 3.8.9 though, because WPEC has started generating HTML product lists of its own, using tables.
     114And obviously if you're templating the content, you can put your own HTML layout on the product list.
    95115
    96116= What's this about a fancy template hierarchy? =
     
    147167
    148168== Changelog ==
     169
     170= 0.6.1 =
     171* Fix bug that caused a rogue less-than sign to appear on purchase receipts.
     172* Fix content-type incompatibility with WPEC 3.8.9's new HTML email generation system
    149173
    150174= 0.6 =
     
    185209== Upgrade Notice ==
    186210
    187 = 0.6 =
    188 A giant new release. Adds a raft of new features, including a template hierarchy and content templating.
    189 See <a href="http://schwambell.com/wp-e-commerce-style-email-plugin/">http://schwambell.com/wp-e-commerce-style-email-plugin/</a> for more details. Ths update is not required for maintenance purposes.
    190 
     211= 0.6.1 =
     212A small update to 0.6. If you're on that version, this version doesn't introduce any changes - it just fixes a couple small bugs that impact purchase receipt emails.
     213
  • wp-e-commerce-style-email/trunk/wp-e-commerce-style-email.php

    r619324 r630043  
    22/**
    33 * @package wp_e_commerce_style_email
    4  * @version 0.6
     4 * @version 0.6.1
    55 */
    66/*
     
    99Description: Style the emails that WP E-Commerce sends to your customers. Create a template file in your theme named wpsc-email_style.php that generates the email output, and use the template tag ecse_get_email_content() to dump WP E-Commerce's purchase report into it.
    1010Author: Jacob Schwartz
    11 Version: 0.6
     11Version: 0.6.1
    1212Author URI: http://schwambell.com
    1313*/
Note: See TracChangeset for help on using the changeset viewer.