HTML Email editing

Viewing 20 posts - 1 through 20 (of 30 total)
  • Author
    Posts
  • #6070
    mike4
    Participant

      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!

      #6071
      Olly
      Admin & Mod

        yeah 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

        #6072
        mike4
        Participant

          Hi Olly,

          I really appreciate the help, I’ll be awaiting for that. Thank you.

          #6075
          Olly
          Admin & Mod

            this 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

            #6077
            mike4
            Participant

              Thank you so much for the quick response Olly!

              I will try that asap. I’ll let you know as soon as possible.

              #6078
              Olly
              Admin & Mod

                no 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….

                #6079
                Olly
                Admin & Mod

                  PPS: —- 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

                  #6080
                  mike4
                  Participant

                    Hi 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!

                    #6081
                    Olly
                    Admin & Mod

                      can you show me the whole code you used ?

                      #6082
                      Olly
                      Admin & Mod

                        also, 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%?

                        #6083
                        Olly
                        Admin & Mod

                          just 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)

                          #6084
                          Olly
                          Admin & Mod

                            in 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

                            #6085
                            mike4
                            Participant

                              Hi Olly,

                              Just sent you an email with a screenshot/mockup. Looking forward to hearing from you.

                              #6087
                              Olly
                              Admin & Mod
                                #7432
                                Regine Endres
                                Participant

                                  Hi 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 previously

                                  #7433
                                  Olly
                                  Admin & Mod

                                    will 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)

                                    #7445
                                    Olly
                                    Admin & Mod

                                      i 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” ?)

                                      #7448
                                      Regine Endres
                                      Participant

                                        Hi 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

                                        #7455
                                        Olly
                                        Admin & Mod

                                          that link doesn’t work

                                          #7464
                                          Regine Endres
                                          Participant

                                            Hi Olly,

                                            Somehow I managed to crash my multi site yesterday, but it is back and the link works now.

                                            Thanks

                                            Regine

                                          Viewing 20 posts - 1 through 20 (of 30 total)
                                          • The topic ‘HTML Email editing’ is closed to new replies.