View Full Version : Email pages
TiggyPig
03-May-2003, 04:00 PM
Is it possible to add a button on a product so that people can email that page link to a friend.
NormanRouxel
03-May-2003, 05:59 PM
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
!!<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.
<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
pinbrook
03-May-2003, 06:13 PM
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!
NormanRouxel
04-May-2003, 02:26 AM
Try this:-
!!<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
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
NormanRouxel
05-May-2003, 09:39 PM
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
TiggyPig
06-May-2003, 09:04 AM
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...
:confused:
jmedinger
06-May-2003, 09:33 AM
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
NormanRouxel
06-May-2003, 09:36 AM
I see your error
<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
NormanRouxel
06-May-2003, 09:49 AM
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
jmedinger
06-May-2003, 01:19 PM
Wonderful,
Thanks Norman
I'll give it a whirl
Cheers
Jos
TiggyPig
07-May-2003, 02:08 PM
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.
:D
NormanRouxel
07-May-2003, 05:54 PM
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
smiffy
13-Dec-2003, 08:35 AM
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>
TiggyPig
13-Dec-2003, 10:45 AM
smiffy, talk to Steve at www.harlequindomains.co.uk he did ours ok.
Mark
smiffy
13-Dec-2003, 11:10 AM
OK thanks - I'll have a word with Steve on Monday.
jacy
13-Dec-2003, 01:13 PM
Hi there,
this is the code i have to add the "tell a friend about this product" to my site
<var thisloc=location.href;if(this.value != ''){location.href='mailto:' thisProduct=getProdName();var thisPrice=getProdPrice();'+ this.value +'?subject=Take a look at http://www.jacyscomputers.com.au &body=I saw ' + thisProduct + '* at Jacys Computer Supplies for only '+thisPrice+ '!Here is the link: '+thisloc+' There are loads of other great products at great prices!'}"><input type=image src="http://www.jacyscomputers.com.au/acatalog/email_a_friend.gif" name="email a friend" alt="email a friend" width="100" height="32"></span>
the trouble is the only thing i can get to work is the image. I click on the image but it doesn't open up my email client (pocomail)
It's a bit of a mix of the codes that have been posted which is probably why it doesn't work :)
I would like this (workable) button to show under each product. my default product template is ACT_productline template. no image laid out in rows.
Is that the template I should put the code into? if so where exactly.
This isn't on my website. I did a site priview and added the code to the preview page that opened up just to see if i could get it to work.
Cheers and thanks again
Jacy
www.jacyscomputers.com.au
pinbrook
13-Dec-2003, 02:39 PM
heres the surfwax code, all in a table, paste it into act-productline.html or whatever your productline template is
<table width="100%" border="0" cellspacing="0" cellpadding="2" align="left">
<tr>
<td rowspan="2">
<div align="center"><img src="http://www.surf-wax.co.uk/acatalog/santa.gif"></div>
</td>
<td><font color="#FF0000">WANT THIS FOR XMAS?</font> send an email to
the person who might buy it for you!</td>
</tr>
<tr>
<td>
<input type=text value="enter email address here" size=40 onChange="var thisloc=location.href + '#NETQUOTEVAR:PRODUCTANCHOR';if(this.value != ''){location.href='mailto:' + this.value +'?subject=Want to know what to buy me for Xmas? &body=I saw '+thisloc+' and thought it would give you an idea!'}" name="text">
<input type=button value="OK" name="button">
</td>
</tr>
</table>
Jenny
13-Dec-2003, 02:50 PM
I set up a php script in a brochure page that allows the person to fill in their name, email, their friend's name and email, builds the email up and sends it to the friend. Only tells them about the site though but does not involve their email client.. Not quite what you wanted but I like it! Still on our test site http://www.paws4inspiration.co.uk/test/acatalog/Tell_a_friend.html
Jenny
jeff p
13-Dec-2003, 11:04 PM
Amazing to see this thread reactivated immediately after returning from an event where someone asked if we had a "e-mail to friend button".
Got Norman's code to work in the description but like others couldn't get it to work in Act_ProductBody. Is there a specific place it should go? Tried two locations without success. Would be much easier than cutting and pasting into hundreds of product descriptions.
Finally, e-mail box is appearing immediately after description, before OtherInfo link and before component inputs. Any way to get it to come just above the Buy button?
Thanks for any help.
jeff p
13-Dec-2003, 11:09 PM
Oops, Jo...posted previous reply before seeing your code. So I don't screw things up royally (which I seem prone to do) where exactly in Act_ProductLine should it go?
Thanks.
NormanRouxel
14-Dec-2003, 02:12 AM
In Act_ProductLine.html the Cart Button (and any choices) are implemented by the line
<Actinic:ACTIONS>NETQUOTEVAR:ADDTOCARTBUTTON</Actinic:ACTIONS>
Put Jo's code either above or below this line depending on whether you want it before or after the cart button.
Norman
jacy
14-Dec-2003, 10:15 AM
Hi there,
This is the HTML from my act_productlinetable.html file. I've almost got it right, but there are 3 things missing.
1. I would like to like to include a link directly to the product and not just the website. i tried putting '+thisloc+' but thats exactly what came out in the email and not the actual link?
2. i have added the bcc option and while when the email program opens up it has the correct email in the bcc field it doesn't come to me.
3. I would like the email a friend button to be on the same line as the buy now button, aligned to the left so it's right under the price.
have a look here (http://www.jacyscomputers.com.au/acatalog/Web_Cam.html) and see where the button is at the moment.
Again thanks for your patience and help,
Jacy
NormanRouxel
14-Dec-2003, 12:46 PM
You can't just mix JavaScript and HTML. You can only have JavaScript within an HTML tag as part of an event like onclick or onchange, for example.
My original example provided a text input box which the customer could enter the e-mail address of the recipient. Are you trying to do away with this and let the customer choose the address when their e-mail program comes up?
Norman
jacy
14-Dec-2003, 07:20 PM
Hi Norman,
Yes I just wanted the image and when a person clicks on it their email program opens up with the product name in the body of the email and also the exact location. I may have to go back to your original post.
Cheers,
Jacy
NormanRouxel
14-Dec-2003, 07:46 PM
OK got you now. Here's a simple way to do that using just a single <IMG..> tag and the javascript in the onclick handler of that image.
<img src="email_me_to_a_friend.gif" alt="email a friend" width="100" height="32" border="0"
onclick="location.href='mailto:'
+ '?subject=Take a look at www.jacyscomputers.com.au'
+ '&bcc=recommend@jacyscomputers.com.au'
+ '&body=I just saw the following product - NETQUOTEVAR:PRODUCTNAME - at '
+ location.href + '#NETQUOTEVAR:PRODUCTANCHOR '
+ 'and thought you might be interested.';">
I've split it onto several lines for readability - you could make this a single long line.
Norman
jacy
14-Dec-2003, 07:58 PM
Excellent!!
Thanks Norman, I'll give it a go
NormanRouxel
14-Dec-2003, 08:06 PM
I edited my above post for readability. Better take another look in case you got the earlier one.
This is just a single <IMG...> tag (even though spread over sevaeral lines of code) so it will be easy to place on the page.
Norman
jacy
15-Dec-2003, 05:11 AM
Norman,
Your a genius!! Thank you very much for your help. It's exactly what i was after :)
Cheers,
Jacy
smiffy
15-Dec-2003, 07:52 AM
http://www.flowertastic.co.uk/email_me_to_a_friend.gif
Does this image actually belong to anyone? :D
TiggyPig
15-Dec-2003, 08:07 AM
Yup, I created it, but feel free to use it if you like.
Mark
jacy
15-Dec-2003, 08:11 AM
Hi Mark,
My apologies. I sould have asked you before i used it.
Thank you for the use of your image.
cheers,
Mitch
TiggyPig
15-Dec-2003, 08:18 AM
S'ok mate, you can put a link on your site to us if you like and we can do vice versa, all good networking practice. Share those customers.
jacy
15-Dec-2003, 08:47 AM
No Worries Mark,
I'll do that once I get my links page up and running.
Cheers,
Mitch
mccanm
26-Feb-2004, 09:27 AM
Norman
This works well, but one further question; If I wanted the above code to look like a text link rather than an image link how would I add in the <a href> tags around the text. I'm afraid my Javascript isn't up to much yet.
thanks
Mark
smiffy
26-Feb-2004, 10:20 AM
Would you guys be interested in a link with my flowers, balloons and teddybear site?
www.flowertastic.co.uk
NormanRouxel
26-Feb-2004, 10:27 AM
This works well, but one further question; If I wanted the above code to look like a text link rather than an image link how would I add in the <a href> tags around the text. I'm afraid my Javascript isn't up to much yet.
This thread is way too long for me to know what bit of above code you're referring to.
Could you post the bit you're talking about to avoid uncertaintity.
Norman
Napolean
27-Feb-2004, 03:06 PM
im looking for something simlar to email a friend, a link on every page that allows a potential customer to email their name , phone number and the product page they are looking at directly to the sales department, allowing our sales staff to phone them right back, I can see how a slight alteration to the script would do the trick,
my question is how do i set it up so the email come directly to our sales office, while at the same time hiding the address from spammers
NormanRouxel
27-Feb-2004, 04:16 PM
Napoleon,
Try sticking this somewhere appropriate in your Product Template(s):
Enter your phone number and we'll call right back
<br><input id="PHO-NETQUOTEVAR:PRODUCTREFERENCE" type=text value="" size=20>
<input type=button value="Phone Me"
onclick="var thisloc=location.href;
var thisphone = document.getElementByID('PHO-NETQUOTEVAR:PRODUCTREFERENCE').value;
if(thisphone != ''){
location.href='mailto:myaddress@'
+ 'mydomain.com'
+ '?subject=Call me back on '
+ thisphone
+ '&body=Product '
+ thisloc}">
You edit the bits "myaddress" and "mydomain.com" to suit.
Spammers won't see this as your e-mail address is pretty well obfuscated by being split over two lines and assembled by JavaScript.
You could also investigate using one of these e-mail to SMS type services (don't ask me - I know nothing) so that your mobile would get the message as soon as it's sent.
Norman
Napolean
01-Mar-2004, 03:11 PM
Thanks Norman
Must be that monday feeling, I have added the code to Act_Productline2.html, see attached file please, it all looks good but i get error on page when i try submit the details. I have a feeling this is because I have placed the script inside the form tag, any ideas where im going wrong please
Regards
Napolean
www.rackingplus.com
NormanRouxel
01-Mar-2004, 03:44 PM
Ooops. An extra capital letter crept in.
The line
var thisphone = document.getElementByID('PHO-NETQUOTEVAR:PRODUCTREFERENCE').value;
Shoud be
var thisphone = document.getElementById('PHO-NETQUOTEVAR:PRODUCTREFERENCE').value;
if you're not eagle eyed, the difference is ID is wrong it should be Id
Norman
NormanRouxel
01-Mar-2004, 03:47 PM
For anyone else reading there's a bug in my post of 3 above. Here's the amended one.
Code to add to Act_ProductLine.html (or any other Product Template) to add a "We'll call you back" type of phone number field and button.
Enter your phone number and we'll call right back
<br><input id="PHO-NETQUOTEVAR:PRODUCTREFERENCE" type=text value="" size=20>
<input type=button value="Phone Me"
onclick="var thisloc=location.href;
var thisphone = document.getElementById('PHO-NETQUOTEVAR:PRODUCTREFERENCE').value;
if(thisphone != ''){
location.href='mailto:myaddress@'
+ 'mydomain.com'
+ '?subject=Call me back on '
+ thisphone
+ '&body=Product '
+ thisloc}">
You edit the bits "myaddress" and "mydomain.com" to suit.
Spammers won't see this as your e-mail address is pretty well
obfuscated by being split over two lines and assembled by JavaScript.
Napolean
02-Mar-2004, 07:51 AM
Norman your a star..thank you it now works a treat
as for eagle eyed on a monday morning..well thats a diffrent matter
Regards
Napolean
www.rackingplus.com
ocbon
09-Mar-2004, 12:09 AM
Hi Norman,
For the code (the one to be put in Act_BodyProduct.html) below - where should it be put to work. What does this mean - The mailto is executed as soon as the input field changes.
I have tried several options from these posts and cannot get a button to show up. Want the button to show for every product. Does the button always show, or does the customer have to do something to activate it?
Thanks,
Bonnie
Originally posted by NormanRouxel
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
!!<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.
<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 :)
NormanRouxel
09-Mar-2004, 01:53 AM
Not Act_ProductBody.html - it goes either directly into your product description or your product template.
Also there's a spurious "<" in one of the lines you posted above. It should be:-
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">
Here is a more up-to-date and easier to edit version. This is the "e-mail a friend" code.
<br>
Enter e-mail address to tell a friend
<br>
<input id="EML-NETQUOTEVAR:PRODUCTREFERENCE" type=text value="" size=25>
<input type=button value="Tell.."
onclick="var thisloc = location.href;
var address = document.getElementById('EML-NETQUOTEVAR:PRODUCTREFERENCE').value;
if( address != ''){
location.href = 'mailto:' + address
+ '?subject=Take a look at ' + thisloc
+ '&body=I saw ' + thisloc + ' and thought you would be interested.'
}">
Put this into Act_ProductLine.html (just below the line
<span class="actxsmall">NETQUOTEVAR:DATEPROMPT </span>) and it will appear on every product.
Norman
Norman
ocbon
10-Mar-2004, 09:13 AM
Norman,
This works like a dream! And so easy to produce! Much easier than the other posts. Thank you very much.
Is there anyway of collecting the email address which is entered?
:) :) Again, thanks
Bonnie
ocbon
10-Mar-2004, 10:13 AM
In setting up the email a friend code, exactly where would I place the actual image for this code to work? In the Pictures folder of my Site 1 folder?
<img src="email_me_to_a_friend.gif"
Thanks
Bonnie
NormanRouxel
10-Mar-2004, 11:52 AM
In Site1. You may also need to add it into Advanced / Additional Files if it doesn't show up on your live site. You may also want to put a copy into PreviewHTML so that preview pages display OK.
Norman
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.