View Full Version : email to friend problems
Robert Collins
07-Dec-2006, 07:10 PM
Hi All;
I'm in need of a wee bit of help with emial "tell a friend"
I followed the instructions on page 47 on Actinic 7 advanced users guide (below) (yes I actually read the manual!):) but when file saved it created 4 identical lines of email a friend input boxes Any tips?
Thank you
Including an 'Email A Friend' Link into Actinic
Enter the following code into your product layout template (normally called Act_ProductLine.html)
just before NETQUOTEVAR:NEXT...
Enter e-mail address to tell a friend
<input type=text value="" size=40 onchange="
var thisloc=location.href + '#NETQUOTEVAR:PRODUCTANCHOR';
if (this.value != '') {
location.href='mailto:' + this.value
+'?subject=Take%20a%20look%20at%20NETQUOTEVAR:PRODUCTNAME&body=I%20saw%20
' + thisloc + '%20and%20thought%20you%20would%20be%20interested.'
}
">
<input type=button value="OK">
Duncan Rounding
07-Dec-2006, 07:19 PM
You can add this (below) to your Act_Primary template somewhere instead then it will show once on every page. (It will then just refer to the page instead of the product though - which is fine if you only have one product per page)
<!-- email a friend table begin -->
<table>
<TR>
<TD>Email this page to a friend<br>
<input type=text value="email address" size="12" onchange="
var thisloc=location.href;
if (this.value != '') {
location.href='mailto:' + this.value
+'?subject=Take%20a%20look%20at%2this%2great%2product&body=I%20saw%20
' + thisloc + '%20and%20thought%20you%20would%20be%20interested.%20I%20think%20it%20looks%20great.'
}
">
<input type=button value="OK"></TD>
</TR>
</table>
<!-- email a friend table end -->
Robert Collins
07-Dec-2006, 07:55 PM
Thank You!
That did the trick!
Gratefully Yours
Bob
simbo
10-Feb-2007, 06:57 PM
the link in the sidebar "email this page to a friend" displays in all pages
clicking link opens new broucher page with the form in a fragment, neat because this fragment contains all the script needed.
i got some code i thought would do at first sight, but it sends the friend a link to the form page instead of the page that his buddy actualy wanted him to see.
this is because it uses window.location to retreve the url and i wondered if it could be modified to use window.history.back() in some way to retreve the url of the page the user just clicked in.
my crude attemts at implementing this only result in geting bounced straight back when the browser reads the script.
here is the code in its origonal form:
!!<
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
//Script by Trånn: http://come.to/tronds
//Submitted to JavaScript Kit (http://javascriptkit.com)
//Visit http://javascriptkit.com for this script
var initialsubj="Hay buddy, take a look at this site Tungsten Blades"
var initialmsg="Hi:\n You may want to check out this site: "+window.location
var good;
function checkEmailAddress(field) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
if (goodEmail) {
good = true;
}
else {
alert('Please enter a valid address.');
field.focus();
field.select();
good = false;
}
}
u = window.location;
function mailThisUrl() {
good = false
checkEmailAddress(document.eMailer.email);
if (good) {
//window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+document.title+" "+u;
window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+initialmsg
}
}
// End -->
</script>
<form name="eMailer">
Tell a friend:
<input type="text" name="email" size="26" value=" Enter Address Here" onFocus="this.value=''" onMouseOver="window.status='Enter email address here and tell a friend about this site...'; return true" onMouseOut="window.status='';return true">
<br>
<input type="button" value="Send this URL" onMouseOver="window.status='Click to send an email (with this page address) to a friend! Enter email address above...'; return true" onMouseOut="window.status='';return true" onClick="mailThisUrl();">
</form>
>!!
Duncan Rounding
11-Feb-2007, 05:26 AM
I agree it looks nice to take someone to another page to fill in the form but remember that you want the prospect to buy so the longer you keep the product in front of them the better. By going to another page they no longer see the product nor the 'buy now' button.
If you only want the form to appear on product pages then you could add the code the Act_ProductLine template instead.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.