![]() |
How can I use mailto: in a function? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How can I use mailto: in a function? (/showthread.php?tid=54047) |
How can I use mailto: in a function? - El Forum - 08-20-2012 [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! How can I use mailto: in a function? - El Forum - 08-21-2012 [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. |