Changeset 441437
- Timestamp:
- 09/21/2011 12:57:08 PM (14 years ago)
- Location:
- wp-e-commerce-style-email/trunk
- Files:
-
- 4 edited
-
functions.php (modified) (5 diffs)
-
options_page.php (modified) (2 diffs)
-
readme.txt (modified) (7 diffs)
-
wp-e-commerce-style-email.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-e-commerce-style-email/trunk/functions.php
r437441 r441437 5 5 6 6 global $ecse_email_content; 7 global $ecse_email_subject; 7 8 8 9 … … 18 19 19 20 21 /** 22 * Returns the subject of the email as formatted by WP E-Commerce. 23 * @return String as generated by WP e-Commerce 24 */ 25 function ecse_get_email_subject() { 26 global $ecse_email_subject; 27 if(!is_string($ecse_email_subject)) $ecse_email_subject=''; //just to make sure it's a string 28 return $ecse_email_subject; 29 } 30 31 20 32 21 33 /** … … 28 40 29 41 global $ecse_email_content; 42 global $ecse_email_subject; 30 43 $ecse_email_content=''; //just in case. probably just being paranoid. 31 44 … … 37 50 case get_option( 'wpsc_trackingid_subject' ): 38 51 case __( 'The administrator has unlocked your file', 'wpsc' ): 39 if(!get_option('ecse_is_active')) break; 52 if(!get_option('ecse_is_active')) break; //we are in testing phase, don't do anything to customer emails. 40 53 case 'ECSE test email': 41 54 $ecse_email_content=str_ireplace("\n",'<br />',$message); //keep line-breaks in wp-e-commerce's content when moving to HTML 55 $ecse_email_subject = $subject; 42 56 ob_start(); 43 57 get_template_part('wpsc','email_style'); //the template page should output some stuff, and probabaly include a call to ecse_get_email_content() … … 50 64 } 51 65 $ecse_email_content=''; //clean up to reduce opportunities for data access outside the formatting template 66 $ecse_email_subject=''; 52 67 53 68 return compact( 'to', 'subject', 'message', 'headers', 'attachments' ); -
wp-e-commerce-style-email/trunk/options_page.php
r437441 r441437 9 9 width:400px; 10 10 } 11 .style-emails form#email-style- testing-form {12 border- top:solid 1px #cccccc;11 .style-emails form#email-style-options-form { 12 border-bottom:1px solid #CCCCCC; 13 13 } 14 14 .style-emails input { 15 15 margin-right:5px; 16 } 17 .style-emails textarea { 18 width:400px; 19 height:60px; 20 margin-bottom:10px; 21 } 22 .style-emails form#email-style-wish-form input { 23 display:inline-block; 24 } 25 .sent-message { 26 color:red; 27 margin-bottom:10px; 16 28 } 17 29 </style> … … 22 34 <h2>WP e-Commerce Style Emails</h2> 23 35 24 <form action="" method="post" id="email-style-options-form" name="email-style-options-form"> 25 <input type="checkbox" name="style-emails-active" id="style-emails-active" <?php if(get_option('ecse_is_active')) { echo 'checked="checked"'; }; ?> /><label for="style-emails-active">Style live customer emails</label> 26 <input type="submit" value="Save" name="save-options-submit" /> 36 <br /> 37 <div style="width:400px"> 38 1. Create the 'wpsc-email_style.php' template file in your Wordpress theme. 39 Here's a simple example of what you could put in it:<br /> 40 <br /> 41 <pre> 42 <html><body> 43 <h2><?php echo ecse_get_email_subject(); ?></h2> 44 <?php echo ecse_get_email_content(); ?> 45 </body></html> 46 </pre> 47 2. Preview your styling.<br /> 48 <form action="" method="post" id="email-style-testing-form" name="email-style-testing-form"> 49 <input type="text" value="<?php bloginfo('admin_email'); ?>" name="send-email-address" /> 50 <input type="submit" value="Send a test styled email" name="send-email-submit" /> 51 <?php if(!empty($_POST['send-email-submit'])) echo '<span class="sent-message">Sent.</span>'; ?> 52 </form> 53 3. Turn on the live customer styling when you're satisfied.<br /> 54 <form action="" method="post" id="email-style-options-form" name="email-style-options-form"> 55 <input type="checkbox" name="style-emails-active" id="style-emails-active" <?php if(get_option('ecse_is_active')) { echo 'checked="checked"'; }; ?> /><label for="style-emails-active">Style live customer emails</label> 56 <input type="submit" value="Save" name="save-options-submit" /> 57 <?php if(!empty($_POST['save-options-submit'])) echo '<span class="sent-message">Saved.</span>'; ?> 58 </form> 59 </div> 60 61 62 <form action="" method="post" id="email-style-wish-form" name="email-style-wish-form"> 63 <h3>Contact this plugin's developer</h3> 64 <?php if(!empty($_POST['send-wish-submit'])) echo '<div class="sent-message">Sent.</div>'; ?> 65 <textarea name="send-wish-content">Write some constructive criticism or positive feedback</textarea> 66 <input type="submit" value="Send" name="send-wish-submit" /> 67 or visit <a href="http://schwambell.com">his website</a>. 27 68 </form> 28 69 29 70 30 71 31 <form action="" method="post" id="email-style-testing-form" name="email-style-testing-form">32 <input type="text" value="<?php bloginfo('admin_email'); ?>" name="send-email-address" />33 <input type="submit" value="Send a styled email" name="send-email-submit" />34 </form>35 72 36 73 </div> -
wp-e-commerce-style-email/trunk/readme.txt
r437441 r441437 4 4 Requires at least: 3.2 5 5 Tested up to: 3.2.1 6 Stable tag: 0. 16 Stable tag: 0.2 7 7 8 8 Style the emails that WP e-Commerce sends to your customers. … … 10 10 == Description == 11 11 12 This plugin lets you style the emails that WP e-Commerce sends to your customers, using a simple theme template file. 13 If you are using WP e-Commerce and want to make your automated customer emails a little more stylish, this is a good place to start. 14 To use this plugin, you don't need to know how WP e-Commerce does its emailing. 15 You do need to know how to edit your Wordpress theme, including what a theme template file is. 12 This plugin lets you style the automated emails that WP e-Commerce sends to your customers, using a simple theme template file. 13 To use this plugin, you don't need to know how WP e-Commerce does its emailing, nor necessarily any php. 14 You DO need to know how to edit your Wordpress theme, including what a theme template file is. 16 15 This plugin works with the WP e-Commerce customer emails for: 17 16 … … 25 24 It does NOT do anything to any other emails that Wordpress sends out (though this plugin could be adapted to do that). 26 25 27 Create a template file in your theme named wpsc-email_style.php that generates the html email output.28 Use the template tag ecse_get_email_content() to dump WP e-Commerce's content into it (see the example below).29 26 You can adjust the content that WP e-Commerce creates for customer emails using the Admin tab of the Store settings. 30 This plugin has an admin page where you can activate live email styling or send yourself a test styled email. 31 Note that the format of your customer emails is now HTML, rather than the defaut plain text. 32 In order to maintain readability, line breaks in the original content are automatically replaced with <br /> tags. 27 This plugin has an admin page where you can activate live email styling (after your private design testing) or send yourself a test styled email. 28 In order to maintain readability, line breaks in the original content are automatically replaced with <br /> tags. 33 29 34 Here's the simplest example of what you might put in the wpsc-email_style.phpfile:30 Here's a simple example of what you might put in the wpsc-email_style.php theme template file: 35 31 36 32 <html><body> 33 <h2><?php echo ecse_get_email_subject(); ?></h2> 37 34 <?php echo ecse_get_email_content(); ?><br /> 38 35 </body></html> 39 36 37 40 38 Of course, you'll want to add a lot more html, css and maybe even php to achieve your own style. 41 You may want to consult the 'nets about how html works inside emails. 39 You may want to consult the 'nets about how html works inside emails. 40 41 The plugin's other home on the web is over at <a href="http://schwambell.com/wp-e-commerce-style-email-plugin/">Schwambell</a>. 42 42 43 43 … … 47 47 1. Install through the Wordpress 'Plugin' menu in Wordpress, or upload this plugin's folder to the `/wp-content/plugins/` directory 48 48 2. Activate the plugin through the 'Plugins' menu in WordPress 49 3. Create the 'wpsc-email_style.php' template file and start styling.50 4. Go to the 'Store Email Style' options page and turn on the styling when you're done testing.49 3. Create the 'wpsc-email_style.php' template file in your theme and start styling. 50 4. Go to the 'Store Email Style' options page and turn on the live customer styling when you're done testing. 51 51 52 52 You probably need to have the WP e-Commerce plugin running on a Wordpress website for this plugin to be of use to you. … … 58 58 59 59 If you haven't created the 'wpsc-email_style.php' template file and gone to work on it, this plugin will do nothing to your emails. 60 Also, don't forget to go to the 'Store Email Style' options page and turn on the styling when you're done testing.60 Also, don't forget to go to the 'Store Email Style' options page and turn on the live customer styling when you're done testing. 61 61 62 62 = Can you help me with this? = … … 76 76 After you've created your styling theme template file, you could: 77 77 78 * Create a fake customer with your email address on your e-Commerce website, and go through all the motions; 78 * Create a fake customer with your email address on your e-Commerce website, and go through all the motions; or 79 79 * Go to the 'Store Email Style' options page and click to have a test styled email sent to you. 80 80 … … 87 87 == Changelog == 88 88 89 = 0.2 = 90 * Improve admin settings page. 91 89 92 = 0.1 = 90 93 * Initial public release. 91 94 92 -
wp-e-commerce-style-email/trunk/wp-e-commerce-style-email.php
r437441 r441437 9 9 Description: 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. 10 10 Author: Jacob Schwartz 11 Version: 0. 111 Version: 0.2 12 12 Author URI: http://schwambell.com 13 13 */ … … 44 44 45 45 /** 46 * Add link to the settings page from the installed-plugins page 47 * @param $links 48 * @param $file 49 * @return $links 50 */ 51 function add_settings_link($links,$file) { 52 //$base = 'store-email-style-options'; 53 $base = plugin_basename(__FILE__); 54 if($file==$base) { 55 $links[] = '<a href="options-general.php?page=store-email-style-options">settings</a>'; 56 } 57 return $links; 58 } 59 60 add_filter('plugin_row_meta', 'add_settings_link',10,2); 61 62 63 64 /** 46 65 * Load admin options page 47 66 * @return none … … 60 79 } 61 80 81 if(!empty($_POST['send-wish-submit'])) { 82 $msg = $_POST['send-wish-content'].' 83 84 Sent from '.get_bloginfo('admin_email').' of '.get_bloginfo('siteurl'); 85 wp_mail('[email protected]','ECSE plugin wish',$msg); 86 } 87 62 88 require_once('options_page.php'); 63 89
Note: See TracChangeset
for help on using the changeset viewer.