I'm using simplenews to email my users and I would like to find a way to embed a url to a specific node that automatically logs them in.
(I'm new to this so bear with me..:)
The logic would go something like:
- create newsletter
- embed link {autologin}url
- hit send - the {autologin} is replaced with user/subscriber specific info [username/pass]
- user finds himself logged in and looking at the node/page I wanted.
I am hoping your Easylogin module can help but do you have any ideas how i could tweak it to help me achieve what I want to do?
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | easylogin_url_token.patch | 979 bytes | eflage |
Comments
Comment #1
George2 commentedi have never used simplenews, but what i think you're essentially asking is for a token to be exposed that you could use like this:
[easylogin-url]?destination=simplenewsurl
interesting. i'll have a think and let you know in the next few days.
Comment #2
james_andrews commentedgreat stuff!
Simplenews requires the use of the Token module so that should help.
FYI I'm really only using simplenews as a way of emailing all my users to inform them of a new page/node because they sometimes need a little prodding...
Comment #3
George2 commentedi unfortunately don't have time to do this right now, but patches welcome :)
Comment #4
George2 commentedComment #5
james_andrews commentedUnderstood and thank you.
I'll explore to the best of my ability in the meantime.
Comment #6
George2 commentedsimplenews doesn't use token by the looks of it. so original post is impossible.
however, exposing a url is still a possibility as i want to allow the admin to cucstomise the email that is sent out re: the new url.
Comment #7
james_andrews commentedVery sorry, I must have mistakenly read taxonomy as token.
Do you have any thoughts how to expose a URL that an admin can paste into a newletter that would automatically log recipients in?
Comment #8
George2 commentedyou need simplenews to utilise tokens for their mails. it'll be a good thing actually!
maybe there's already an issue in the queue for simplenews which you can look for, if not create one. there may already be a patch for it.
Comment #9
james_andrews commentedSeems like I'm not alone on this one:
Simplenews Tokens
Once tokens is integrated, how would i go about doing what i was originally intending to do?
Comment #10
George2 commentedyou could submit a patch for me to utilise tokens in easylogin or wait until i get around to doing it! so...patches welcome!
Comment #11
james_andrews commentedI'm not sure how to ask simplenews to expose a token or to patch it.
They have tokens/variables which are:
!site (the name of your website)
!uri (a link to your homepage)
!uri_brief (homepage link without the http://)
!date (today's date)
!login_uri (link to login page)
!confirm_subscribe_url (subscription confirmation link)
!confirm_unsubscribe_url (unsubscription link)
!newsletter_url (link to this newsletter issue)
!newsletter_name (name of this newsletter series)
Do i simply ask them to add something like !easylogin_uri (pulling the url from your module?)
Comment #12
George2 commentedas stated above, simplenews needs to use tokens, otherwise you can't do it. !foo are not tokens.
as a solution to your problem, if you want them to be logged in when they visit a page, how about increasing the session cookie lifetime?
as for the issue, i'm setting this to a won't fix, because, other than this usecase, there's no need for it.
Comment #13
james_andrews commentedI understand and I'll try to find some other means to do this.
FYI this usecase (or the ability to send a link to a page that automatically logs a user in) is quite popular and your module is half the battle... check out the thread around autologin
For the time being I have asked my users to bookmark your easylogin links in the effort to have them visit more frequently.
Comment #14
wroxbox commentedI would like to implement autologin to my newsletters too. I have searched a lot of different solutions.
There is http://drupal.org/project/fastlogin for D5 with the help of http://drupal.org/project/loginticketThere is http://drupal.org/project/easylogin that creates a personal login url for every drupal user.
This sound a good way to do the autologin and not sending username/password as plaintext and use autologin -project. I would like to help, but until a client will pay for the development this is just a POC.
Own edit:
I had a bit of extra time yesterday and implemented easylogin hash to simplenews newsletters.
simplenews.module (line 2099)
add uuid query
and somewhere near line (2130)
So now in newsletter you may add a !easylogin token to allow automatical login for people.
Comment #15
eflage commentedI wanted to be able to insert the easylogin url into emails sent out by the Rules module so I created a patch. This is my first attempt at creating a patch so I apologize if it's not correct.
Comment #16
eflage commentedComment #17
George2 commentedif a few test this, i'll commit.
Comment #18
pedrosperror patching 6.x-1.2 or 6.x-1.x-dev tar.gz (9.67 KB) 2010-Jul-11
sudo patch < easylogin_url_token.patch
patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.
Comment #19
pedrospanyway copy-pasting the patch code (aka manual patch !) works and expose the token !
Comment #20
SeanBannister commentedThis is exactly what I needed. I found a bug in #15 patch, the hash in the URL was being duplicated, the below code fixes it. Sorry I didn't have a chance to roll a patch. Just place this in easylogin.module:
Comment #21
George2 commentednice going everyone! sorry, but i'm abandoning this module - and drupal in general - as i've seen the light!