I'd like to send customers an email with a link to their (private) profile/account page.

This link should contain login credits so they can click to go to their profile page and log in at the same time.

How can I add login info to a url?

3 Answers 3


You can use the add-on LogMeIn to do this exact thing. All it needs is the username to feed into the template. You can achieve that in a variety of ways, some being more secure than others.

The most direct (not so secure) method would be to do the following:

1) Create a template, for example profile/logmein, and put the LogMeIn tag in it like this: {exp:logmein:now username="{segment_3}"}

2) Then have the email you send include a link to the logmein template with their username in the last segment: site.com/profile/logmein/username

Once the user hits that page it'll redirect them to wherever you have that set up.

It's really too simple.

  • It almost sounds too good to be true... Thanks!
    – okenathan
    Commented May 24, 2013 at 8:51

In the admin, if you go to the page of the user (members -> view all -> [select desired user]) You can copy the url of that page and send that to them. This allows them to log in and go directly to their account page.

As far as automatically logging them in, that is dangerous and would be a big security concern. You should never automatically log someone in via and email link. But if you are willing to try you need to enable html in your emails (not all clients support it) and you would have to make hidden inputs to tie directly to your cp. (please do not do that though)

Edit: I do not believe that you can tie a form directly to the login of EE. There are session keys for the form that are for authentication to check that you are in a browser and on that specific page.

  • Thanks, i wouldn't have them log into the CP, but to a personalized, private page.
    – okenathan
    Commented May 21, 2013 at 17:22

Expressionengine logs you in by checking your username and password in the database and then creating a session (a cookie and a corresponding database entry).

It would be pretty simple to add another field in the members table and create a GUID for each member that you use to identify and authenticate the member. You can create either an EE plugin or a CI or raw PHP script that provides a landing page that accepts the GUID as a url parameter and performs the pseudo login. You can then send the url with the GUID via a mailmerge, mailchimp or whatever to your users.

I'm sure you know, but you should do your own risk analysis to be sure that this method is secure enough. Make sure whatever group these members are in doesn't have control panel access etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.