Generate unique link for each website visitor - html

I send 3 different links to people on a daily basis. I know the name of the person I am sending the link to. How do I attach that persons information to the link to know they clicked on the link?
I sent close to 50 emails to different people. I just want to be notified that someone I sent the link to click on it.

You need to use a database for this. The link could contain a random hash that can be looked up in the "emails" table. This table could keep records for timestamps, specifically when the emial was sent out, and when the user clicked the link.
#QUESTION:
Most hosting providers give you the option to hook up a database. If you have trouble finding this, use google or their support. As far as how to "use" a database, you will need to learn this in you own time. But like anything else the basics are widely available through google, which in your case, is all you need to finish your project.

You can add an encrypted or obfuscated field to your URLs identifying the email address.
Common methods:
base64 encoded email address XOR-ed with known key
md5 hash of email address truncated to first N characters
And so on.
The first method allows you to reverse the process (i.e. getting back the email address from the visit log), the second is one-way only.
For example, using the second method with email dude#gmail.com (truncated to 12 characters):
http://domain.com/click.php?v=ec3ab9422d7a
Or, as already said, you can simply use a database and store a key-value pair (email, hash) with, for each email, a random string generated on-the-fly by your massmailer.

Related

Generate a code to each respondent after completing a form

I am conducting a survey among students and I want to measure their attitudes on the beginning and end of the semester.
However, I want the survey to be anonymous.
My question is: Is it possible to create a script in Google Forms which will generate a unique code for each respondent, save that code in the Google Sheets alongside the responses and most importantly, provide the respondent with the code so that in the next round of survey, he/she can insert the code so that I can link the responses from the two surveys.
Thank you so much for all the help!
Yes, you can achieve this with Apps Script. The workflow for getting such functionallity would be as follows:
Using Form Service every time a response is submitted generate a random number. If you want to track your codes so that two users don't end up with the same code (highly unlikely but possible) then store your codes with the responses in the Spreadsheet linked to your form using the Spreadsheet Service, specifically take a look at the methods for getting and setting values in a specific range. You can then compare your generated random number with the codes you already have and if it matches any generate a new random number and check again.
Either send this random number by email using Gmail Service or, in case it has to be completely anonymous set the submit message to display your code.
Then for providing a different form if the user already has an access code you can simply ask the user at the beggining of the form whether they have a code or they dont and depending on that redirect them to the section of the form that you wish. To verify this code you could then on the form response compare his code with the list of codes you already have to verify that this user actually did complete the form previously.
This generally takes several services working in tandem. However, an easy solution might be to have the first field on the form/survey simply ask the user to create and enter a codename for themselves, instructing them to save it (in their phone notes?) for use again at the end of the term. In fact, at the end of the term, you could even print out a full list of JUST the code names and post it for students to peruse, in case they forgot. Each person will certainly recognize the name they chose from a list, while no one else will know who's who. You could even ask them to submit the post-assessment right in class after checking the code name list. And actually, I'm sure most students will get a kick out of seeing (and wondering about) the weird code names that will turn up.

Multi-page login - what is is for?

Some pages, such as amazon and Gmail, separate out the HTML Input fields for E-Mail and Password onto two different HTML pages, one after another.
What is the rationale for this approach instead of asking for credentials on just a single page with one HTML Form that has two Input fields at the same time?
Most of the times this happens with federated identity, when multiple identity providers can actually log you in. For example you can use your company identity provider (ie. login server) to log onto a 3rd party resource which trusts your company IdP.
But the question is then how you choose which provider to use in the 3rd party, if they accept several. And this is one solution: you enter your email address, and your email is associated with your IdP, so you can be redirected to the correct login page (from where you will be redirected back). Of course, your IdP can easily be the site itself, in which case the process looks rather silly.
Note that you can be redirected to the "local" password page regardless of whether your username is actually correct or not, and usually only the domain part of the email is used to decide where to redirect, so it is less of a security issue, user enumeration is still not possible. But you can try and enumerate valid identity providers.

Create a decent unsubscribe method

I've been asked to create a system to send newsletters. A HTML template has been created by an external company. I've got the sourcecode so i can alter it. One thing that was missing was an unsubscribe method. I would like to add a method so that when people click on the link they get an message that they can sent. I would like to process these unsubscriptions automatically but there lies my problem. How can i be sure which user this is? Because if i look at the sender emailadress i can't be 100% sure it is this person. So my question is whether i can incorporate a unique id in the mail and how can i get that unique id in the unsubscribe email?
I've got a system working that can upload the HTML page to a mail and send it. That part works. The email is send to whatever address is in the database in BCC.
Do I need to send each email separately?
Can anyone help me?
Here you can find the unsubscribe link:
Wenst u deze nieuwsbrief niet meer te ontvangen? Schrijf u hier uit <strong>info#odbeeck.be</strong>
Some where in this code i would like to have a unique id so that when i process the email i know which user in the database it represents.
Can anyone point me in the right direction?
Thnx,
If you process it automatically i would propose to add a http://yourdomain.com/unsubscribe?id=abcdef link to the newsletter for unsubscribing. It's mostly done like this, so the user expects it to work like this and it's easy to pass the id parameter.
Other topic: The id should not be passed directly, create a hash over it and use that one for identifying.
You need to send each mail separately. For adding the unique id to each mail you need some templating mechanism or some custom written script.
So my question is whether i can incorporate a unique id in the mail and how can i get that unique id in the unsubscribe email?
Yes.
The email is send to whatever address is in the database in BCC. Do I need to send each email separately?
Yes.
Generate the unique (preferably random and definitely not sequential) id. Store it in a database next to the email address. When the link is clicked look up the email address the id is associated with and unsubscribe using that information.
That said, you would probably be better off outsourcing this to a third party with experience in sending bulk emailing. That will minimise the load on your mail servers and reduce the chance of a screw up causing your mail servers being marked as a source of spam in the various RTBLs.

How Do I Create an html email button that will send back to me an emailed response?

I have a small ecommerce business and from time to time a customer will say that they never ordered the item and I am forced to refund their money due to lack of any confirmation from the customer as to his actually placing the order.
I would like to add either an hmtl button or any sort of tool to the emails that i sent you with the customer's receipt. The customer will get the email with his receipt and also within the email will be a button ("I approve This Transaction") for him to click on that will send me back a confirmation email.
Please advise.
Thanks,
Don
There are 2 ways to do this.
With a mailto: link, this would open the users default email client where they would have to send the email as an extra step.
URL parameter in a normal href/button link (ie: www.yoursite.com/yourpage.php?email=their#email.com). You would link to a webpage (yourpage.php) that would pass that URL parameter (in this example "email", but can be any other info you pass through) you can then parse that URL parameter in your webpage and have it email you automatically based on that info.
Option 2 is the way to go, but requires some coding knowledge (PHP for example). Also, in order to set up unique URL parameters, you'll need a system that uses merge tags to create unique values for each email you send. I'd suggest you should use a transactional email service provider for this.

browsers mailto issue?

i have an application that has to return emails to a user with his email client, but in some cases I have to pass around 1000 emails.
I'm using mailto on href, something like this:
mailto:info#useremail.com?bcc=email1#test.com,email2#other.net,anotherone#dfsf...
Why am I returning to his email client instead using PHP mail() function?
Because the user sender email depends on which computer he is using, and he needs to archive thoose emails.
The problem:
Some browsers, if the email list is bigger than X, it won't send to his preferred email client.
You could output the full BCC list and ask the user to copy-paste it in. But maybe you should just rethink your entire strategy if you want to pass thousands of e-mail addresses to a user.
That's because the length of a GET request (and such a link is a GET request) has a maximum. On some browsers it might only be 2083 characters. So any email address behind that limit will not be send to the client email program. And thousand of email adresses will break the limit.
For anything other than a simple mailto:address with no parameters, mailto: URLs are massively unreliable and should be avoided. URL-length issues are only the beginning.
on some cases i have to pass around 1000 emails...
Even if a mailer could cope with getting the URL, a user's residential ISP is unlikely even to allow them to send that.
Give up. Send the mails yourself from PHP. Send a copy to the user for the archival purposes.
Passing a user thousands of email addresses is very unusual.
Generally, a more typical application would use PHP mail() on the server side, and then allow browsing the archives of whatever notifications have been sent out. The mail stays on and is sent from the web server, but allows the user to see what's gone out in the past.
On the minus side, that's a good bit more code, but probably the only way to fix the problem you're having; mailto: wasn't meant for large volume.