Announcement

Collapse
No announcement yet.

Email pages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Email pages

    Is it possible to add a button on a product so that people can email that page link to a friend.

    #2
    Here's a rough and ready one-liner:-

    Tell a Friend E-mail button on web-pages.

    Enter this (very long line) in the product description if you just want to do this on the odd product

    Code:
    !!<Enter e-mail address to tell a friend <input type=text value="" size=40 onchange="var thisloc=location.href;if(this.value != ''){location.href='mailto:' + this.value +'?subject=Take a look at '+thisloc+'&body=I saw '+thisloc+' and thought you would be interested.'}"><input type=button value="OK">>!!
    or the same in a Template (Act_ProductBody.html might make sense as this will only display on product pages) without the !!< and >!! to make it generally available.

    Code:
    <Enter e-mail address to tell a friend <input type=text value="" size=40 onchange="var thisloc=location.href;if(this.value != ''){location.href='mailto:' + this.value +'?subject=Take a look at '+thisloc+'&body=I saw '+thisloc+' and thought you would be interested.'}"><input type=button value="OK">

    Note that the button is really a dummy. The mailto is executed as soon as the input field changes. It just gives the user something to click on. Note that not all browsers support the subject= and body= parameters but you can probably live with this. Don't put any punctuation in the helpful text bits as they might interfere with the mailto URL.

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      hey Norman!

      Neat script!!

      How do I change it to send the domain name and not the full url?

      The reason for asking is I'd like to use this on a non actinic site, which is template driven. If I use the script as is it refers the template file!!

      Thanks!

      Comment


        #4
        Try this:-

        Code:
        !!<Enter e-mail address to tell a friend <input type=text value="" size=40 onchange="var thisloc=location.hostname;if(this.value != ''){location.href='mailto:' + this.value +'?subject=Take a look at '+thisloc+'&body=I saw http://'+thisloc+' and thought you would be interested.'}"><input type=button value="OK">>!!
        Norman
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Hi Norman,
          Great little code, I've used it succesfully in a paticular product by entering the code in the product description. It works fine without problems.

          I have been trying to get the second variation (without the !!< >!!) to work by putting the code in Act_ProductBody.html and a few other places but it just puts the ok button without the email field box.

          Any ideas?

          (using v6.12 with pretty standard templates)

          Any help appreciated

          Simon

          Comment


            #6
            OK. If you're in a product template then you're inside <form...> and </form> tags and that's where <input..> statements are valid. I kindof forgot to mention that as you're nearly always within a form in Actinic.

            If you're outside of a form (like at the top of Act_Primary) then try adding <form> just at the beginning and </form> at the end of the example I gave.

            You can't nest <form..> statements so make sure you won't be breaking Actinic by doing that accidentally.

            Norman
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              AmI being silly here?

              I cannot get the code Norman gave to work ( have tried the <FORM> </FORM> option)

              All I want is a button at the bottom of each individual product that enables people to send that product via email to someone else.

              I've added my Act_ProductBody code to so you can see where I have messed up...

              Attached Files

              Comment


                #8
                Hi Norman,

                Is there any way of making this script either product specific (so it calls the product name and includes it in the email) ...

                ...or at the least, automatically providing an anchor to the product that the viewer has filled in the text field on?

                Cheers

                Jos
                Thanks

                Jos Medinger

                Tel : 01978 843 962
                www.internetology.co.uk
                Actinic / E-Commerce Hosting, Design & SEO
                ______________________________________

                Comment


                  #9
                  I see your error

                  Code:
                  <FORM><Enter e-mail address to tell a friend <input type=text value="" size=40 onchange="var thisloc=location.href;if(this.value != ''){location.href='mailto:' + this.value +'?subject=Take a look at '+thisloc+'&body=I saw '+thisloc+' and thought you would be interested.'}"><input type=button value="OK"></FORM>
                  See the "<Enter". take out the "<". Your poor old browser thinks it's an <Enter...> tag (whatever that is) and gobbles up the code until it sees a ">". Yum yum. Now lumbering with a bit of indigestion it restarts from the <input type=button...>, which is why you don't see the e-mail field.

                  However read on. This could be a bad place for that code as you'll already be inside a form in Quantity on Product page with Single Add to Cart and outside said form without the Single Add.

                  You may have to move this code to Act_Primary.html to be sure you're in a safe place. After the NETQUOTEVAR:FORMEND should be a safe place.


                  Norman
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    Jos,

                    Use on a Product page template and stick in NETQUOTEVAR:PRODUCTNAME where you want the name to appear. Yes you can probably link straight to the products anchor but I've not time to test that now. I guess you'd change

                    "I saw '+thisloc+' and"

                    to be

                    "I saw '+thisloc+'#aNETQUOTEVAR:PRODUCTREFERENCE and"

                    Try it and see.

                    Norman
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Wonderful,

                      Thanks Norman

                      I'll give it a whirl

                      Cheers

                      Jos
                      Thanks

                      Jos Medinger

                      Tel : 01978 843 962
                      www.internetology.co.uk
                      Actinic / E-Commerce Hosting, Design & SEO
                      ______________________________________

                      Comment


                        #12
                        So, can we add this script to every single product? All I really wanted was a button that said "Email to a friend" and then sent an email with a link directly to that poroduct.

                        Comment


                          #13
                          The version above without any NETQUOTEVAR's will work anywhere. The ones with NETQUOTEVAR's will only work inside Product Templates.

                          I also looked at getting the product name to be included on the e-mail but since quotes are legal within such names some products would break the JavaScript.

                          Norman
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            I'm having a play with this. but like TiggyPig I just want a buttom to generate the email.

                            How do i use the variable +thisloc+ with a button?

                            The code below is in Act_ProductLine.html It converts the product variable in the body, but I cant see how to get the url into there too.



                            <a NAME="sectionbottom" var thisloc=location.href;if(this.value != '' href="mailto:?subject=Take a look at +location.href+ &bcc=recommend@giftsonline.ltd.uk&body=I saw this NETQUOTEVAR:PRODUCTNAME at '+thisloc+' and thought you would be interested.">
                            <img src="email-friend.gif" width="69" height="15" border="0"></a>

                            Comment


                              #15
                              smiffy, talk to Steve at www.harlequindomains.co.uk he did ours ok.

                              Mark

                              Comment

                              Working...
                              X