WP-e-Commerce icon indicating copy to clipboard operation
WP-e-Commerce copied to clipboard

Themable, HTML email

Open leewillis77 opened this issue 12 years ago • 22 comments

Purchase receipts, and reports should be HTML by default, and easily themable, with a sensible default based on industry best practice.

Some samples we can use / borrow from: https://github.com/mailchimp/email-blueprints https://github.com/zurb/ink

leewillis77 avatar Dec 30 '13 20:12 leewillis77

Massive +1 to this.

JustinSainton avatar Dec 30 '13 20:12 JustinSainton

It could be argued that this should be a plugin, but I'm a huge proponent of this being in core. I get asked about it all the time, and the plugin that does this currently (WPEC Style Emails, I think it's called) is pretty hacky.

JustinSainton avatar Dec 30 '13 20:12 JustinSainton

Yep - I'm just integrating Mandrill into my store and the hacks I'm using are horrible ... The half-plain text half-(invalid)-HTML we currently generate is interesting to say the least.

leewillis77 avatar Dec 30 '13 21:12 leewillis77

Ha, yeah, no doubt about that. Is this something you think you'd be interested in building out, or are you thinking a more community-driven approach?

JustinSainton avatar Dec 30 '13 21:12 JustinSainton

In Lee we trust!

It'd be good if there was something industry standard we could fork / use?

d

Sent from my iPhone

On 31/12/2013, at 10:11 am, JustinSainton [email protected] wrote:

Ha, yeah, no doubt about that. Is this something you think you'd be interested in building out, or are you thinking a more community-driven approach?

— Reply to this email directly or view it on GitHub.

instinct avatar Dec 30 '13 21:12 instinct

Ink looks really interesting!!

Sent from my iPhone

On 31/12/2013, at 9:54 am, Lee Willis [email protected] wrote:

Purchase receipts, and reports should be HTML by default, and easily themable, with a sensible default based on industry best practice.

Some samples we can use / borrow from: https://github.com/mailchimp/email-blueprints https://github.com/zurb/ink

— Reply to this email directly or view it on GitHub.

instinct avatar Dec 30 '13 21:12 instinct

Just to confirm, I am working on this as and when time allows. I've had a good look at Woo do, and what EDD are proposing, and think I've got a rough idea of what we need, so here's what I'm aiming for:

  • A generic WPSC_Email class that handles the sending of emails, filters, auto plain-text generation etc.
  • Updating the existing email generation code to use that to send
  • Also updating the existing email generation code to use themable HTML chunks using the existing theme approach (There may be use for a generic class in there, not sure till I get to it).
  • A standard template based on either the Ink, or Mailchimp repos.

Nowhere near finished, or usable yet, but all code stored here in the meantime: https://github.com/leewillis77/WP-e-Commerce/commits/html_email for anyone who's interested.

leewillis77 avatar Jan 04 '14 14:01 leewillis77

This is great Lee!! Out of curiosity what are you thinking - Ink or Mailchimp? Or too early to say ?

d

Sent from my iPhone

On 5/01/2014, at 3:56 am, Lee Willis [email protected] wrote:

Just to confirm, I am working on this as and when time allows. I've had a good look at Woo do, and what EDD are proposing, and think I've got a rough idea of what we need, so here's what I'm aiming for:

A generic WPSC_Email class that handles the sending of emails, filters, auto plain-text generation etc. Updating the existing email generation code to use that to send Also updating the existing email generation code to use themable HTML chunks using the existing theme approach (There may be use for a generic class in there, not sure till I get to it). A standard template based on either the Ink, or Mailchimp repos. Nowhere near finished, or usable yet, but all code stored here in the meantime: https://github.com/leewillis77/WP-e-Commerce/commits/html_email for anyone who's interested.

— Reply to this email directly or view it on GitHub.

instinct avatar Jan 05 '14 19:01 instinct

Hi Dan,

I'm note it makes much difference to be honest - it should really be easy to swap out one for the other. Happy to take guidance from anyone who has a strong opinion about the particular choice of template :)

leewillis77 avatar Jan 06 '14 21:01 leewillis77

I agree - we should make a decision in core, but make it easy to swap out (a filterable class of sorts). I personally lean towards Ink, but that's just personal preference. Depending on the design decisions you make, @leewillis77, it might not even need to be a filterable class - just a matter of having default theme templates and people swapping them out and redesigning as needed.

JustinSainton avatar Jan 06 '14 21:01 JustinSainton

Thanks @JustinSainton :)

Thats +1 for Ink and 0 for mailchimp. Ink has a pretty active repo in github by the looks of it.

instinct avatar Jan 06 '14 21:01 instinct

Exactly what is needed. Nice one.

domjngo avatar Jan 10 '14 13:01 domjngo

Hey @leewillis77 how are things going mate? Where did you get with this one?

instinct avatar Feb 26 '14 01:02 instinct

@leewillis77 Unless you want to lead the efforts here for 3.9, I'll go ahead and move this over to a future release.

JustinSainton avatar May 03 '14 21:05 JustinSainton

any more thoughts on this one for 3.9 ? @leewillis77 if you could get this happening it'd be amazingly helpful for the WPEC efforts going forward... is there any chance you could make a start or share more thoughts on it?

danmilward avatar May 16 '14 00:05 danmilward

I started on this, and made some reasonable progress. Everything is on GitHub here:

https://github.com/leewillis77/WP-e-Commerce/tree/html_email

What this does so far:

  • Adds a WPSC_Email class that can be used to send plain text or HTML email
  • Adds 77 tests for said class :)
  • Adds new template files for (plain-text header, plain-text footer, HTML-header, HTML-footer). There are wrapper classes that just get pre-pended/appended to the email content.

Still to do are:

  • [ ] Better logic for discovering the right email template to use (See https://github.com/leewillis77/WP-e-Commerce/blob/html_email/wpsc-includes/wpsc-email.class.php#L226)
  • [ ] Convert existing plugin code to use the class - tidying up any output as we go
  • [ ] Tidy up some default content into the templates [Store name, URL etc.]
  • [ ] Moar tests :)
  • [ ] Anything else anyone thinks should / should not be in the class

leewillis77 avatar May 19 '14 22:05 leewillis77

@leewillis77 Awesome work man!!

I wonder if it would make sense to extend WPSC_Purchase_Log_Admin_Notification and WPSC_Purchase_Log_Customer_HTML_Notification respectively?

Seems to me that there is some overlap between WPSC_Email and what those classes do? I could imagine the WPSC_Email class being stripped down to the template handling and content stripping primarily? ( html_to_plain_text(), apply_template(), get_template_part() ).

Thoughts on that?

JustinSainton avatar May 19 '14 22:05 JustinSainton

@leewillis77 Would love to see this in 4.1. Think you'll have bandwidth to shepherd this through completion in the next few months?

JustinSainton avatar Feb 10 '15 19:02 JustinSainton

Do you have a timeline in mind for 4.1? If it's going in it should go in early to get plenty of testing!

I'm embroiled in fun legal things for the next week or two, but after that should be able to massage the final bits. From memory, we have a working email class, just need to make WPeC actually use it ;)

leewillis77 avatar Feb 12 '15 07:02 leewillis77

Love fun legal things! 4.0 should be out in the next 4-6 weeks, so sometime after that we'll spin up 4.1 development. That work for you?

JustinSainton avatar Feb 12 '15 07:02 JustinSainton

Yep!

leewillis77 avatar Feb 12 '15 20:02 leewillis77

Related: #505, #387, #2259

JustinSainton avatar Feb 13 '17 21:02 JustinSainton