HTML Email editing

Viewing 10 posts - 21 through 30 (of 30 total)
  • Author
    Posts
  • #7467
    Olly
    Admin & Mod

      >it’s definitely the correct function.php file

      no it isn’t, that file should be named functions.php

      #7479
      Regine Endres
      Participant

        Hi Olly,

        oh, no, so sorry!

        I can see already changes on the order. So it is picking it up now.

        Thanks and sorry again.

        Regine

        #7506
        Regine Endres
        Participant

          Hi Olly,

          I managed to get the logo on top of my email. 😉

          Now I would like to add some more text in this field:
          “Order Email: Text you would like to display at the end of emails after everything else.”

          Like I want to add the full address of the restaurant like this:
          El Mexicano Armadale
          Shop 21 Jull Street, Armadale
          Phone: 9399 5494

          I tried adding <br>, but it has translated them into text. Is there a way to enter returns in the field or would you need to change the field in WordPress for this?

          I think the address is definitely missing especially for pick ups.

          Thanking you in advance.

          Kind regards

          Regine

          #7521
          Olly
          Admin & Mod

            as of 2.11.7.5:
            i have added action hooks to the end of the email templates .
            (wppizza_emailhtml_end and wppizza_emailplaintext_end)
            you can now use to do stuff there

            #7556
            Regine Endres
            Participant

              Hi Olly,

              Thanks for the update and your message.

              To be honest the action hooks are a bit of a mystery to me, as I have not really got much idea how they work and what I can do with it.

              Ie If I put them in my functions.php file and add the restaurant address, does it mean that only I as programmer can change the content? Or can I refer to a specific field in wordpress?

              Also I don’t actually know how to write the full code to add it in my functions.php file, so I am a bit lost here.

              Would you please consider writing an FAQ post on how to use action hooks and how it works?

              Thanking you in advance

              Regine

              #7558
              Olly
              Admin & Mod

                do this (should at least get you going)

                
                add_action('wppizza_emailhtml_end','myprefix_emailhtml_end',10,4);
                function myprefix_emailhtml_end($order_summary, $order_items, $htmlEmailStyle, $labels){
                echo'<tr><td colspan="2" style="'.$htmlEmailStyle['mailPadding']['2x15'].'; font-size:90%;text-align:middle">'.$labels['order_email_footer'].'<td></tr>';	
                }
                

                >Would you please consider writing an FAQ post on how to use action hooks and how it works?

                no, as there’s a site for that already. it’s called http://codex.wordpress.org/ (alongside about another 1/2 million websites that explain how actions and filters work…..)

                #7559
                Olly
                Admin & Mod

                  in fact, i would strongly encourage you to get to grips with actions and filters.
                  once you do, you’ll be amazed as to what you can do…

                  one thing to know bear in mind (as that’s a common mistake i made myself once upon a time)
                  although actions and filters are somewhat similar. they have one vital difference.

                  actions do things
                  filters change things

                  actions tend to have some parameters passed to them which you can use (amongst other things) to echo/print things (based on the variables passed along to them if you want/need to)

                  filters have variables passed to them where – typically – the first one needs to be returned but you can change it during the processing of the function as required (quite often there are some more parameters passed along that first one, which you can use to change what the first one returns as appropriate..)

                  #7560
                  Olly
                  Admin & Mod

                    so, (and then i shut up)
                    if you find a “do_action” hook, it doesnt do anything unless it’s called by an “add_action” somewhere (in your functions.php typically)

                    same goes for filters
                    i.e if there is an “apply_filters” hook it just returns what’s been passed to it, unless you do/change something by adding “add_filters ” somewhere (in your functions.php typically)

                    essentially, most/all wordpress plugins – so wppizza too – use the existing wordpress hooks to do their thing and add/extend stuff

                    #7582
                    Regine Endres
                    Participant

                      Thanks heaps Olly,

                      I will have to work through this in the next days. Yes, always happy to learn new stuff.

                      Thanks again.

                      Kind regards

                      Regine

                      #7636
                      Regine Endres
                      Participant

                        Hi Olly,

                        Thanks again for the information.

                        I got an acceptable result, but still need to learn lots more about hooks.

                        THanks

                        Regine

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