![]() |
How to pass users pw through email?
Ok long story short, hostmonster (my host) shut off my outgoing emails because someone reported the birthday email as spam. They said I need an auto opt out link put in place before they enable my outgoing emails.
I installed ... https://vborg.vbsupport.ru/showthread.php?t=246163 and then asked them to enable my emails. They said no because it's not an auto opt out. They said since the user has to click on the confirm button it's not automated. So I need to know how to pass the users pw in the automated emails to them, and pass the userid and userpw back to the system in order to automatically log them in, and then automatically opt them out of the emails. I don't think this is a good idea (to pass the login info back and forth), but it's what the host demands and I need to get it done asap. |
I'm not sure how you'd go about doing that, but I have another idea that might work - put the email address on the url as a parameter, then use a plugin similar to the one for the mod you have installed excpet that the query would check the email address rather than the userid (which it could do without being logged in). It's true that with that scheme anyone who knew a member's email address could unsubscribe them, but that's not really a serious security issue. If you wanted, later you could add something like an automatic PM to the user telling them they'd been unsubscribed, so they could resubscribe if it's a mistake.
If you did implement this, one thing you might want to do is change the plugin code so that it only ever displays one message (like "thank you, you're unsubscribed") even if you're passed an invalid email, that way it couldn't be used to guess at member's emails. |
Hi again Kevin :)
I want to thank you for all of your help today sure made it go a lot faster :) However I don't have a clue about how to make this plugin. I thought that you had to login in order to change settings, are you saying that the plugin will change the settings for the user based on their email address without them having to log in? I had an idea, include the form in the outgoing emails ... but would it work? I can't really test this as the host has outgoing emails turned off, and I don't have any email clients configured on my localhost :p |
Quote:
Quote:
Quote:
You could write a plugin that checks the username and password if it was passed in a form, but it would have to be html email and so it would depend on the user viewing the mail in html. |
You are klh over there right?
I'll have to go through this tomorrow as I'm a bit too tired to be working on it now :( I mainly need this for the birthday emails since that is what has been reported by some disgruntled members. Would it be as simple as replacing $username with whatever the email variable is? So instead of saying hello John Lester blah blah blah it would say hello jlester@whatever.com Then making a plugin (that's where I'll need the most help) that will set the user options without them having to login? |
Quote:
It's late for me as well. I don't think inserting the address will be a problem. Maybe tomorrow I can throw something together. |
Morning Kevin :)
So I had a thought, all this plugin would have to do is move the user to a different user group when the "unsubscribe" link is clicked on from their email. |
You could move the user to another group if that's what you want. The mod you have installed unsubscribes the user from admin emails using pretty much the same sql that we talked about in the other thread, so that should work too.
I've been thinking about this too. What I wanted was a way to either automatically add the link to every email that goes out, or else have a way to put something in the email body phrase that would insert the link. I haven't figured out either one yet. But that doesn't mean we couldn't come up with something just for the birthday emails, if that's your current problem. I was thinking I might come up with something general that could be released and might help others, but that can wait. |
Well my plan was to edit every outgoing email body phrase to add the link :) What I'm unsure of is how to execute the link permission wise. I'm still a complete noob more or less when it comes to coding.
Sometimes I can take a mod and tweak it (like I did with unsubscribe one), but as far as knowing how to do something from scratch ... well I can't :D |
Quote:
The problem with that (using my scheme, anyway) is that the user's email address can be in a different variable for each body phrase. I also think that the address would need to be encoded in some way to be part of a url, so that makes it more complicated. There may not be any "good" way (using only hooks) to do what I was thinking about. But I think it's exactly the same problem if you need a way around the user having to log in, no matter how you choose to do it. I suppose to some people it's important enough that it's worth editing one or more of the vb files if necessary. BTW, I was just wondering - someone else asked about this same problem just yesterday - is that someone else from your site? Or maybe someone having the same problem with the same host. |
Umm I don't know who that someone else is, point me to the thread and I'll go see :D
I never knew the email address would be in different variables ... to me it makes no sense. What really baffles me is how the host can insist on something like this that doesn't appear to be easily accomplished on one of the biggest forum softwares out there. I mean I know (ok assume since I can't "know") that 98% of all vBulletin users don't have this retarded one click opt out. I haven't found a mod anywhere that does this. But, I have seen other places that automatically opt you out by clicking a link sent in an email, but I have no real idea how. I assumed it was a javascript and all it did was delete the address from a mailing list. Either that or it was a completely bogus opt out :D Which to be honest is what I'm thinking of doing until I get a real working solution :D It wouldn't be hard to pull off (I know hostmonster will check I've raised too much hell over this for them not to once I tell them it's done), just disallow registered users to subscribe to anything, then run a couple queries to deselect some options and viola! the wool has been pulled over their eyes :D |
I was talking about this: www.vbulletin.org/forum/showthread.php?t=285357 . It looks like he found the same mod you did.
I would say it isn't so much that it's difficult to implemt as it is that the system just wasn't designed for it. A lot of the code (I think) is pretty much the same as it's been for many years. And the software also wasn't really designed for modifying (without file edits). The plugin system helps a lot but you're still at the mercy of the hook placement within the code (in other words there are a lot of things you just cannot change using a plugin). I've heard that long ago all mods were done by file edits, so I suppose we're spoiled. :) Anyway, I know there's some urgency on your end, so I'll think about what we can do to get you going, but it will probably be later this afternoon at the earliest (unless someone else reads this thread and comes up with a better idea). --------------- Added [DATE]1341932122[/DATE] at [TIME]1341932122[/TIME] --------------- ...but I guess I'm kind of defending vbulletin when your point was really that your host is being unreasonable. I think you're right, like you said, if many other people had that requirement it would be done already. |
Ah I saw his replies and told him I can not give him the changes I made without the author's ok.
I've been thinking, could a plugin be created to prevent a usergroup from being able to check the options for emails? I know you can turn them off by default via the acp, but then the user can just turn them on. I figure with the changes to the user groups I made last Aug when we switched hosts to hostmonters, if the registered usergroup is not allowed to change those settings I won't have this issue anymore. I'm not in a life or death hurry, my users know it's the hosts fault :D I had to turn of confirmation of new registrations though so I prepared my moderators for a possible influx of spammers :( I think a plugin that moves them to a different usergroup would be easiest right? --------------- Added [DATE]1341938412[/DATE] at [TIME]1341938412[/TIME] --------------- If we can update this to work on 4.1.x it will satisfy my retarded host. https://vborg.vbsupport.ru/showthread.php?t=224315 --------------- Added [DATE]1341938804[/DATE] at [TIME]1341938804[/TIME] --------------- The main difference between the old mod I linked and the one I installed is that the old one doesn't require the user to log in. But since I just spent 1.5 hours with my crappy hosts "support" I can't see how it works. |
Quote:
Anyway, we can convert that mod - it's even marked reusable. |
1 Attachment(s)
OK, I just ported the mod you mentioend above to vb4.2.0, and I'm attaching it here so you can try it. Let me know if you need anything changed. If it works I'll post it in the mod section.
|
Afternoon :)
It looks like it works just fine on my test site (4.1.12) but I don't think it will conform with their guidelines. I don't see the difference between having it send an unsubscribe email that they have to wait on, then click again, and having to log in to click a button. Since I'm still blocked from sending emails I can't test it on the live site, and I still don't have an email client configured for my localhost so I never got the unsubscribe email :D --------------- Added [DATE]1341962024[/DATE] at [TIME]1341962024[/TIME] --------------- Basically it needs to do all of the work once the user clicks the link/button. It can not send an email, or go to a confirmation page (unless there's no other links/buttons to click). I'm seriously starting to hate hostmonster. --------------- Added [DATE]1341962673[/DATE] at [TIME]1341962673[/TIME] --------------- Yep just as I thought, they don't like that one either. I so wish I could crawl through the screen and light their damn lawyers on fire and toast some marshmellows while listening to Black Sabbath :D |
OK, well, I can make the "double opt-out" (as it's apparently called when you have to click the email link) optional. I can make it so that you just enter an email address and it's unsubscribed. BTW, you shouldn't have to log in at all for this to work - but I probably should have mentioned that you need to uninstall the other mod first, I think they use the same hooks and values for "do", so if you saw a log in message it may be because they're interfering with each other.
--------------- Added [DATE]1341963004[/DATE] at [TIME]1341963004[/TIME] --------------- Quote:
What don't they like about it? Just having to click the email link? So if I can get it to be a screen where you enter an email and press "unsubscribe", and you don't have to log in to do it, that should be OK? |
Yes I uninstalled the other one first :)
They don't like the 3 step process. Step 1 being clicking on the link in the email. Step 2 entering the email address and clicking a button/link. Step 3 being receiving another email with another link/button to click. They want at most 2 steps. Click on link from email and goto an unsubscribe page, enter email on the page and click a link/button and be done. --------------- Added [DATE]1341965571[/DATE] at [TIME]1341965571[/TIME] --------------- So no "double opt outs" or "double confirmation" pages. --------------- Added [DATE]1341966737[/DATE] at [TIME]1341966737[/TIME] --------------- Holy cow I'm some sort of stupid. I may have found a ready made answer here at vbulletin.org :D https://vborg.vbsupport.ru/showthread.php?t=266142 Depending on what Fillip says to my questions of course :) I have no idea why I didn't look for an email manger system...I concentrated on an "opt out" system. --------------- Added [DATE]1341967265[/DATE] at [TIME]1341967265[/TIME] --------------- I am eternally grateful for all of the time and patience you have devoted towards my problem, and I would be even more grateful if you continued on this quest in case the dbtech mod won't satisfy my host. I think you should expand the settings that your ported version of this mod changes. These are what I had done in the other mod that my host says won't work for them. Code:
$db->query("UPDATE " . TABLE_PREFIX . "user SET options= options - 256 WHERE (options & 256) AND userid=" . $vbulletin->userinfo['userid']); Of course you don't have to, but I think it would be a popular addition in my nooby opinion :D --------------- Added [DATE]1341969797[/DATE] at [TIME]1341969797[/TIME] --------------- Quote:
|
I've started to work on this, but I haven't gotten very far - I almost forgot to check this thread to see if you made any progress. Anyway, do you still need this? I only glanced at the dbtech mod, but it looks like it does a lot, so there may still be some use for a mod that simply makes it easy for members to unsubscribe by setting the options.
Do you happen to know if setting each of those user options to No and deleting all subscriptions covers everything? I was actually thinking of maintaining a list of addresses and checking it in the mail send function as a way of ensuring that no email was sent to someone who opted out (assuming they wanted to opt out of all emails from the site). Edit: you also mentioned moving the user to another group, do you still think that would be a useful option? I thought I'd just start with setting the admin email option to no, then go from there. |
Couldn't you use the misc.php?do=$userid as the link posted and then in a pluging get the userid (remember i know nothing of JS :))
PHP Code:
PHP Code:
If you do happen to sort this code out as a one link click (vb3 & vb4 hopefully) i'd like to see it ;) |
I'm not sure I follow what you're doing there. You wouldn't want a link that unsubscribes someone by userid (and didn't require logging in) because it would be too easy for someone to unsubscribe everyone, for instance.
But anyway, we're talking about a link you click on from an email, so we probably wouldn't want to use javascript. And after more discussion in the thread we've decided that it's enough if it takes you to a page where you enter your email to unsubscribe. Apparently the big problem they had was making it so you have to log in to unsubscribe. I actually appreciate that because sometimes you just don't want to receive email from a site anymore and you don't want to have to try to remember how to log in. |
Quote:
Quote:
Quote:
I'm actually going to tweak that user group once we get this working to limit the pm inboxes and such to encourage people who do use the unsubscribe but want to use pms to "double opt in (opt in 1 by requesting a user group change and opt in 2 by having to select (or not) the options to get emails) to cover my butt in case they later complain. --------------- Added [DATE]1342028394[/DATE] at [TIME]1342028394[/TIME] --------------- Oh my sometimes I really wish I could afford to get new glasses :D There is a bitfield for emailonpm in the useroptions group. It's 4096. I guess the choice depends (in my case for sure) on whether or not you include the changing of user groups. If you include the changing of user groups then I suggest turning off the emailonpm option vs turning off pms altogether. If you don't include the changing of user groups then i would suggest turning off pms altogether. Just my $.02 as this is your baby and I'm just along for the ride :D |
Quote:
|
Just tested the emailonpm bitfield and it works like a charm :)
Code:
$db->query("UPDATE " . TABLE_PREFIX . "user SET options= options - 4096 WHERE (options & 4096) AND userid=" . $vbulletin->userinfo['userid']); Quote:
However I am the noob here so who knows if I'm even close to being right :D --------------- Added [DATE]1342029051[/DATE] at [TIME]1342029051[/TIME] --------------- Kevin once the method is decided (either the current route you're pursuing or this new one suggested by Simon) and working I really think that adding these options in the ACP would be a great idea. Give the admins the choice on which of the options are affected by the unsubscribe button, which user group to move them to (if that's included), and give them the ability to customize the phrase without having to edit the xml (which is how I do it if the mod doesn't have ACP settings :D ) |
Quote:
Quote:
|
Quote:
EDIT: this is out of the cron for birthdays PHP Code:
PHP Code:
|
Yes, that would work for birthdays. That's what I was thinking a couple of days ago, and I told John if he just wanted something to deal with the birthday emails we could throw together something quick, but since then it's become my understanding that he'd really like to have a more general solution (but maybe I'm wrong about that).
Edit: oh, right - the other thing I was concerned about is that I think some email addresses might have characters that require URI encoding before adding the addreses to a url, so I didn't want to just add it directly. (In particular, I believe '&' is allowed in an email name). |
1 Attachment(s)
OK, here's the latest. There are some options in the adminCP, probably all the way at the end in the last section. The "require login" doesn't completely work yet so just leave it as "no" (and that makes it pretty much is like the "unacceptable" version anyway).
|
Kevin it's not inserting the unsubscribe link on my live site (emails are temporarily restored for testing). I have it enabled and have the double opt out and require log in set to no.
I have "receive emails from admin" checked and am using instant notification for subscribed threads. |
Quote:
|
Ummm hmm let me try something real quick :D NO the other did not insert a link in the outgoing emails.
--------------- Added [DATE]1342041474[/DATE] at [TIME]1342041474[/TIME] --------------- Ok with the old one I'd visit urlhere/misc.php?do=unsub and click the unsubscribe button. This one when I visit urlhere/misc.php?do=unsub I see my smilies page :D So I have no idea what's going on right now :( |
Oh, sorry, that is my fault. I decided to change the "do" values so that they wouldn't conflict with the other mod (which now that I think about it might not have been a good idea since some people might want to replace the other mod with this one).
Anwyay, the current one uses do=unsubscribe instead of do=unsub. --------------- Added [DATE]1342041966[/DATE] at [TIME]1342041966[/TIME] --------------- I guess I should try that dbtech mod. So far this hasn't been a big deal, but before I spend any more time I should make sure I'm not making a poor imitation of what they've done already. |
Ok it works :) But it can't find phrase klh99_unsublink_done
--------------- Added [DATE]1342042115[/DATE] at [TIME]1342042115[/TIME] --------------- If you don't mind I'll be tweaking it to turn off those other options as well just to cover my butt :) |
Quote:
Tweaking what to turn off what? You can do whatever you want of course, but if you want to install the final mod when it's done then you probably won't want to do a lot of phrase editing just yet (unless you don't mind repeating it :) ) I'm going to try to release a first version tonight. If nothing else that will let us continue this discussion in the mod thread instead of annoying everyone in the forum by continuously bumping this thread :). |
1 Attachment(s)
Right now your version only deselects "receive emails from admin", the older one that I tweaked deselects a few more options and sets thread subscriptions to "do not subscribe".
I forgot to attach the tweaks I made to the older mod for you to see :p I changed the name of the mod so I wouldn't import the wrong one, but the attached is the old mod with my tweaks. |
Quote:
--------------- Added [DATE]1342042972[/DATE] at [TIME]1342042972[/TIME] --------------- BTW, I think setting autosubscribe to -1 just stops the automatic adding of subscriptions to threads. If you want to also delete existing subscriptions, you'd have to delete the records from the subscription tables. |
Yes all it does is change the setting, I haven't even attempted to delete existing subscriptions because technically it's not needed since deselecting "receive email from admins" stops them from being sent.
At least that is my understanding of what "receive email from admins" actually does. --------------- Added [DATE]1342043294[/DATE] at [TIME]1342043294[/TIME] --------------- The reason I added the change to subscriptions was basically just testing to make sure I understood what I was doing :D --------------- Added [DATE]1342043372[/DATE] at [TIME]1342043372[/TIME] --------------- As you probably have seen with my tweaked version of the old mod, I'll be changing the phrase to something very similar depending on the final product :) |
Quote:
I'll try to have a somewhat stable version tonight so you don't have to change things more than once (unless of course you're happy with the current one, then you don't really *have* to install any other version). |
Well the only emails we send out are: birthday, subscriptions, pm notifies, infractions, and some user to user emails.
I will be putting the url in every "email body text" so I should be covered either way :) No need to go digging around for past subscription stuff :D --------------- Added [DATE]1342046806[/DATE] at [TIME]1342046806[/TIME] --------------- Well now this is a bit odd, when I click on the "more" link on my smilie page it tells me it can't find the phrase unsubscribe_done and redirects me to the index page O.o |
Quote:
I've been trying to test if turning off admin emails stops subscription emails, but I'm frustrated by the fact that it can take 10 minutes or more just to receive an email that I send myself. I guess I need to put debug statements in the code to make sure. Quote:
What does the url say? I don't see how that could happen in my mod - all the code is inside if statements checking the value of "do". --------------- Added [DATE]1342050219[/DATE] at [TIME]1342050219[/TIME] --------------- OK - I'd feel better if I could do a "real" test with emails, but I'm pretty sure that turning off admin emails doesn't stop subscription emails. I think the idea is that the users have control over what they subscribe to, so there's no need for a setting. But, it OK because it's actually an easy query or two to remove all subscirptions for a user. Well, OK, more than a couple. I was just looking at the database and there's also socialgroup group and discussion subscriptions and event reminders. Edit: ..and one more thing, I was hoping to release this tonight but I think I'm done with this stuff for today, I hope that's not a problem. --------------- Added [DATE]1342052683[/DATE] at [TIME]1342052683[/TIME] --------------- One more thing - I think I am being stupid. While I was testing the subscription emails I noticed that not only does it already contain a link to remove the subscription, the link also has some kind of "auth" code that removes the subscription in one click without needing to log in. I'm going to look in to that tomorrow. |
All times are GMT. The time now is 07:39 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|