BeckyKing Posted May 1, 2014 Share Posted May 1, 2014 I have recently built and designed a HTML email which is fine and working. What I need to create now is the 'view in your browser' link and the page to include the customers name which is on the email? Also I need to create an unsubscribe page which I don't know if possible could link to a spreadsheet or if I need a mysql database or if it easier to just send myself an email. If anyone could help it would be much appreciated. Link to comment Share on other sites More sharing options...
davej Posted May 1, 2014 Share Posted May 1, 2014 What I need to create now is the 'view in your browser' link and the page to include the customers name which is on the email? Huh? Link to comment Share on other sites More sharing options...
BeckyKing Posted May 2, 2014 Author Share Posted May 2, 2014 So on a email you will have a 'view in your browser' if the email does not display correctly which will show the email in your browser. The email will have a customers name on the email and I want that display if the click the link? Hope that makes more sense. Link to comment Share on other sites More sharing options...
davej Posted May 2, 2014 Share Posted May 2, 2014 Can you link to an example? Link to comment Share on other sites More sharing options...
BeckyKing Posted May 7, 2014 Author Share Posted May 7, 2014 (edited) I have recived an email from Hargreaves and it says 'Dear Miss King'. I clicked on 'View in browser' and this is the link I get. I want to do exactly what they have done and have 'Dear Miss King' on the link as per below. http://links.h-l.co.uk/servlet/MailView?ms=NDU4MDU2MzYS1&r=OTE1NDQwNDY0NTAS1&j=NDQwNzM1ODQ3S0&mt=1&rt=0 Edited May 7, 2014 by BeckyKing Link to comment Share on other sites More sharing options...
davej Posted May 7, 2014 Share Posted May 7, 2014 Oh, you are writing an HTML email message. The most obvious solution would be to put the body of the email online somewhere and then provide a link to it. Link to comment Share on other sites More sharing options...
BeckyKing Posted May 7, 2014 Author Share Posted May 7, 2014 Which is what I was planning on doing but how do I get the name 'Dear Miss King' into that link? There will be loads of other emails that I will be sending with different names. Link to comment Share on other sites More sharing options...
davej Posted May 7, 2014 Share Posted May 7, 2014 The simplest option is to leave the name blank. Another option would be to put the name in the URL and use Javascript or Php to read the URL and insert the customer name into the body of the page. Link to comment Share on other sites More sharing options...
BeckyKing Posted May 7, 2014 Author Share Posted May 7, 2014 Another option would be to put the name in the URL and use Javascript or Php to read the URL and insert the customer name into the body of the page. Do you know any tutorials which could help me with this? Link to comment Share on other sites More sharing options...
davej Posted May 7, 2014 Share Posted May 7, 2014 You can look at... http://www.w3schools.com/js/tryit.asp?filename=tryjs_change_innerhtml http://www.w3schools.com/jsref/prop_loc_search.asp http://www.w3schools.com/jsref/jsref_indexof.asp http://www.w3schools.com/js/js_htmldom_methods.asp To produce something like... <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>URL Link Grabber</title><script>window.onload = init;function init() {document.getElementById('btn1').onclick = test;var url = location.search;if (url!=''){var idxfirst = url.indexOf('&first=');var last = url.substring(6,idxfirst);var first = url.substring(idxfirst+7);document.getElementById('name').innerHTML = first +' '+ last;}else{alert('url=[empty]');}}function test(){var urlbase = location.href;var urlsearch = location.search;if (urlsearch==''){var url = urlbase;}else{var idx = urlbase.indexOf('?');var url = urlbase.substring(0,idx);}var first = document.getElementById('first').value.trim();var last = document.getElementById('last').value.trim();var str = url+'?last='+last+'&first='+first;document.getElementById('testlink').href = str;document.getElementById('testlink').innerHTML = str;}</script></head><body>Enter name:<input type="text" id="first" value="John"/><input type="text" id="last" value="Smith"/><input type="button" id="btn1" value="Create Link"/><p>Insert the above name into the link:</p><a href="#" id="testlink">test link</a><h3>Dear <span id="name"></span>:</h3></body> </html> 1 Link to comment Share on other sites More sharing options...
BeckyKing Posted May 8, 2014 Author Share Posted May 8, 2014 Great thank you for your help. I will try this out :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now