Welcome Guest, Not a member yet? Register   Sign In
How can I use mailto: in a function?
#1

[eluser]mact1079[/eluser]
I have a simple invite link that opens up the user's default email program to send friends a randomly generated invite code in order to create an account on an invitation only app. I decided to do this instead of creating a form so that the user can use their own contact list vs inputting emails.

Code:
<a href="mailto:?subject=Invitatione&body=Link http://domain.com/aTsg72">Invite</a>

How can I go about creating the random invite code when the user clicks the button AND then still open up the default email client with mailto: or perhaps some other function? I think I'm ok with generating the random code with a button click but I'm not sure how to continue the mailto: functionality.

I could create the invite code on page load and then just plug it into the link I suppose but I don't want to create invite codes that fill the DB without the user taking the action.

Any help much appreciated!! Your newest Codeigniter fan!
#2

[eluser]DarkManX[/eluser]
You can hash some user specific data and add it to the link. The user-id will also be needed to match the hash with the user. If no security required just add the user-id to the link, thats all.




Theme © iAndrew 2016 - Forum software by © MyBB