WPPizza – A Restaurant Plugin for WordPress › Support › Code Snippets WPPizza v2.x (read only)
(Code Snippets for v3.x) › HTML Email editing
- AuthorPosts
- 10 November, 2014 at 9:09 pm #6070
Hi Olly,
Just a quick question. Sorry if this has been answered before.
Any change you could help me out with the editing of the HTMl email? I can’t seem to just replace the “Tittle” of the header where it shows my site’s name with some custom text and put the logo in.
I’m sure I’m just missing something. If possible, can I do this with functions instead of editing the template directly?
Thank you so much in advance!
10 November, 2014 at 9:32 pm #6071yeah i know,
it’s not the most intuitive way of editing/filtering (other than actually changing the template directly)must do something about this in the not too distant future.
as it stands though, its a matter of using a filter (which i will keep regardless…in the future too… so as to not break things when i get round to make things better so to speak)
give me a bit (i guess will be tomorrow now) and i’ll post an example
10 November, 2014 at 10:15 pm #6072Hi Olly,
I really appreciate the help, I’ll be awaiting for that. Thank you.
10 November, 2014 at 11:27 pm #6075this would work (just tested it) – adds the wordpress logo to the header as background image
add it to your themes functions.php and edit/adjust as required
add_filter('wppizza_filter_html_email_style', 'my_html_style_filter'); function my_html_style_filter($htmlEmailStyle) { /*set background image in header**/ $htmlEmailStyle['mailHeaderBackgroundImage']="width:303px;height:53px;background:url('http://s.w.org/style/images/wp-header-logo.png') center center no-repeat transparent;"; /*if you also want to hide the text there, add this too**/ $htmlEmailStyle['mailHeaderBackgroundImage'].="text-indent:-9999px;"; return $htmlEmailStyle; }
essentially, you can put a whole bunch of css declarations in there according to your needs (just make sure they are valid)
hope that helps
10 November, 2014 at 11:30 pm #6077Thank you so much for the quick response Olly!
I will try that asap. I’ll let you know as soon as possible.
10 November, 2014 at 11:37 pm #6078no problem.
as i mentioned, i’ll probably add some more things to that template to also be able to filter whole td’s, or tr’s . but it’s not imminent…time being the problem as always….
10 November, 2014 at 11:58 pm #6079PPS: —- not tested though —–
some/many email clients will not display remote images (unlike attached/local ones) unless the user specifically allows this .
as an educated guess, you could however probably go to wppizza->order settings->Email Attachments and attach an image to the email which you could then use as background as above, replacing
url('http://s.w.org/style/images/wp-header-logo.png')
with just
url('attachment-img-name.png')
again, not tested/tried, but I think this should work
11 November, 2014 at 12:12 am #6080Hi Olly!
It works great, however, I used the whole filter but it doesn’t hide the text there. Also, the size of it can’t bee 100%? To cover the whole BG.
Thank you so much!
11 November, 2014 at 12:23 am #6081can you show me the whole code you used ?
11 November, 2014 at 12:31 am #6082also, can you perhps send me a screenshot / mockup (to dev[at]wp-pizza.com) how you actually want this to look ? maybe i misunderstood what it is you want to achieve
> I used the whole filter but it doesn’t hide the text there. Also, the size of it can’t bee 100%?
11 November, 2014 at 1:00 am #6083just tried this with a gmail account, and a negative text-indent does not work because google – in their infinite wisdom – think they know better……sigh
looks like i need to do the tr/td filter sooner rather than later .
you could mess around with some margins/paddings/text colours too mind you….
then agian , with a bit of luck, i get to that in the next couple of days and do an update (and post a solution here)
11 November, 2014 at 1:03 am #6084in the meantime, you could use a positive indent (i.e 9999px instead of -9999px) , but it will stretch the email to full width in google (albeit “normal” email clients seem to be happy)
in any case, the tr/td filer i was talking about above is probably the best solution anyway, but i need some sleep first
11 November, 2014 at 1:28 am #6085Hi Olly,
Just sent you an email with a screenshot/mockup. Looking forward to hearing from you.
11 November, 2014 at 9:03 am #608728 January, 2015 at 2:24 pm #7432Hi Olly
I tried both, the add filter solution with a path to my logo and the path changed with the full path in the email attachment field in the WP=Pizza settings.
It doesn’t seem to recognise anything at all. I also tried to use a copy of the template in my theme folder and adjusted the colours, but nothing at all happened.
I just want the logo on the top of the email.
Please could you help me here?
Thanking you in advance
Regine
new.elmexicano.net.au/armadale
login as provided previously28 January, 2015 at 5:00 pm #7433will have a more indepth look tomorrow (am somewhat between airports)
am guessing though that you put the code in the wrong functions.php (just a guess, could be all sorts of other things)29 January, 2015 at 11:13 am #7445i do not have access to your theme functions.php with my login, so cannot really say what the issue might be.
however, are you sure you put your customisations in the right functions.php ? (i.e in the functions.php of “el mexicano order foxy” ?)
29 January, 2015 at 12:05 pm #7448Hi Olly,
I checked, it’s definitely the correct function.php file in the correct theme.
Screen shot of file here:http://new.elmexicano.net.au/wp-content/themes/ElMexicano-Order-foxy/images/functionphpimage.png
Thanks
Regine
29 January, 2015 at 8:40 pm #7455that link doesn’t work
29 January, 2015 at 11:56 pm #7464Hi Olly,
Somehow I managed to crash my multi site yesterday, but it is back and the link works now.
Thanks
Regine
- AuthorPosts
- The topic ‘HTML Email editing’ is closed to new replies.