vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to pass users pw through email? (https://vborg.vbsupport.ru/showthread.php?t=285376)

John Lester 07-10-2012 01:04 AM

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.

kh99 07-10-2012 01:22 AM

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.

John Lester 07-10-2012 01:44 AM

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

kh99 07-10-2012 01:59 AM

Quote:

Originally Posted by John Lester (Post 2346559)
I want to thank you for all of your help today sure made it go a lot faster :)

You're welcome. Are you talking about over on vbulletin.com? I didn't really think anyone knew who I was over there because I have a different username.

Quote:

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?
The plugin can do whatever it wants - it can check for a user being logged in, but it doesn't have to. But one thing I didn't really think of is that this method would mean customizing the email for each user by inserting the email address in the link. The existing mod currently doesn't do that because it knows the userid by being logged in.


Quote:

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

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.

John Lester 07-10-2012 02:06 AM

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?

kh99 07-10-2012 02:15 AM

Quote:

Originally Posted by John Lester (Post 2346566)
You are klh over there right?

Yeah, I guess I'll have to be more careful - I thought I was relatively anonymous over there. :)

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.

John Lester 07-10-2012 10:34 AM

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.

kh99 07-10-2012 11:41 AM

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.

John Lester 07-10-2012 12:06 PM

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

kh99 07-10-2012 12:18 PM

Quote:

Originally Posted by John Lester (Post 2346656)
Well my plan was to edit every outgoing email body phrase to add the link :)


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.

John Lester 07-10-2012 12:33 PM

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

kh99 07-10-2012 12:43 PM

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.

John Lester 07-10-2012 12:56 PM

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.

kh99 07-10-2012 03:05 PM

Quote:

Originally Posted by John Lester (Post 2346670)
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

Oh, OK - so I guess the problem isn't that the link didn't unsubscribe with one click, but that you needed to log in? That makes it easier since you can ask the user to enter his email address instead of having to customize the message.

Anyway, we can convert that mod - it's even marked reusable.

kh99 07-10-2012 06:20 PM

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.

John Lester 07-10-2012 08:59 PM

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

kh99 07-10-2012 09:29 PM

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:

Originally Posted by John Lester (Post 2346794)
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


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?

John Lester 07-10-2012 10:11 PM

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']);
$db->query("UPDATE " . TABLE_PREFIX . "user SET options= options - 2097152 WHERE (options & 2097152) AND userid=" . $vbulletin->userinfo['userid']);
$db->query("UPDATE " . TABLE_PREFIX . "user SET options= options - 32 WHERE (options & 32) AND userid=" . $vbulletin->userinfo['userid']);
$db->query("UPDATE " . TABLE_PREFIX . "user SET options= options - 2048 WHERE (options & 2048) AND userid=" . $vbulletin->userinfo['userid']);
$db->query("UPDATE " . TABLE_PREFIX . "user SET autosubscribe = -1 WHERE autosubscribe = 0 OR 1 OR 2 OR 3 AND userid=" . $vbulletin->userinfo['userid']);

It disallows vcard download, unchecks all 3 of the email ticks (where receive email from admin is), sets thread subscriptions to "do not subscribe", and turns off pms (to prevent any pm related emails going out).

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:

Originally Posted by kh99 (Post 2346807)
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.

The more I think about it, the more I think this route is the way to go, and what you described here is exactly what is required. I think I'd rather go this route than installing a semi complex mod (at least to me since I don't know jack about email managers :D ) like the one I listed earlier.

kh99 07-11-2012 01:10 PM

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.

Simon Lloyd 07-11-2012 01:59 PM

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:

<script type="text/javascript">
    function 
vistedurl()
    {
     
$UnSubsUrl window.location.href;  
    }
</
script

like this
PHP Code:

if ($_REQUEST['do'] == 'vistedurl')
{
$uid substr(  $UnSubsUrl strrpos(  $UnSubsUrl '=' )+);


that line will find the last occurrence of = and give everything after it. Ok thats probably messed up but it might give you an idea for the link they can click to unsubscribe in a 1 click action if the plugin then has a query to unsubscribe the userid :)

If you do happen to sort this code out as a one link click (vb3 & vb4 hopefully) i'd like to see it ;)

kh99 07-11-2012 02:54 PM

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.

John Lester 07-11-2012 03:21 PM

Quote:

Originally Posted by kh99 (Post 2346981)
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.

The mod won't work as far as my host is concerned because it doesn't handle the system emails which are the only emails I send out.

Quote:

Originally Posted by kh99
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).

As far as I can tell those settings are all of the settings that would trigger an email. I suppose you could not turn off pms and turn off the emailonpm bitfield, but that bitfield is in the group name=regoptions (vs the group name=useroptions where all of the bitfields we talked about are grouped) which I haven't really fiddled around with yet.

Quote:

Originally Posted by kh99
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.

I think it is a viable option as it would be another layer of opting out in my opinion. I had created a user group back in Aug of last year that has all of the settings that would send emails turned off except for pms. I would move those users that sent me a reply to the birthday email asking to be un-subscribed, or if the emails were bounced. Since then I've installed https://vborg.vbsupport.ru/showthread.php?t=138884 to handle the bounced emals and am loving that mod :) (well until the host blocked all outgoing emails but that's not the mods fault :D )

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

Simon Lloyd 07-11-2012 03:40 PM

Quote:

Originally Posted by kh99 (Post 2347016)
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.

Ok well it could still be the email address that you tag on so when the user clicks the link in his email something like /misc.php?do=vistedurl&myemail@myaddress.com it will take you to the site, you wouldn't need to log inbut triggering the misc should cause the plugin to do the rest - well thats as simple as i saw it in my head :)

John Lester 07-11-2012 03:45 PM

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']);
--------------- Added [DATE]1342028910[/DATE] at [TIME]1342028910[/TIME] ---------------

Quote:

Originally Posted by Simon Lloyd (Post 2347034)
Ok well it could still be the email address that you tag on so when the user clicks the link in his email something like /misc.php?do=vistedurl&myemail@myaddress.com it will take you to the site, you wouldn't need to log inbut triggering the misc should cause the plugin to do the rest - well thats as simple as i saw it in my head :)

If that would indeed work as I can envision it in my head, the user wouldn't have to enter their email address as the plugin could populate the email address automatically. That way all they'd have to do is click the unsubscribe button.

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 )

kh99 07-11-2012 04:04 PM

Quote:

Originally Posted by Simon Lloyd (Post 2347034)
Ok well it could still be the email address that you tag on so when the user clicks the link in his email something like /misc.php?do=vistedurl&myemail@myaddress.com it will take you to the site, you wouldn't need to log inbut triggering the misc should cause the plugin to do the rest - well thats as simple as i saw it in my head :)

Yeah, that's pretty much what I thought (see post #2), and it's almost what we're doing except that I haven't quite worked out a way to get the email address into a customized email, so we're using a form for the user to enter their email instead. Most vb emails are sent using a phrase but the info like user name and email that are used to customize it are in different variables depending on where the phrase is used, and there's something like 70 email body phrases. Also (and as usual) it's limited by available hooks. I think what I might end up doing is releasing this with the form method, then later adding instructions for a code modification in case someone wants the automatic links.


Quote:

Originally Posted by John Lester (Post 2347036)
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 )

That's what I'm doing right now. I think it's almost done but I haven't tested it yet. So, probably I'll attach another version here in an hour or two.

Simon Lloyd 07-11-2012 04:38 PM

Quote:

Originally Posted by kh99 (Post 2347039)
Yeah, that's pretty much what I thought (see post #2), and it's almost what we're doing except that I haven't quite worked out a way to get the email address into a customized email, so we're using a form for the user to enter their email instead. Most vb emails are sent using a phrase but the info like user name and email that are used to customize it are in different variables depending on where the phrase is used, and there's something like 70 email body phrases. Also (and as usual) it's limited by available hooks. I think what I might end up doing is releasing this with the form method, then later adding instructions for a code modification in case someone wants the automatic links.




That's what I'm doing right now. I think it's almost done but I haven't tested it yet. So, probably I'll attach another version here in an hour or two.

Couldn't you add to current phrases $userinfo['email'], or in each of the cron files add your custom misc.php link? just thinking out loud ;) brain farts usually but sometimes there's pearls!

EDIT: this is out of the cron for birthdays
PHP Code:

while ($userinfo $vbulletin->db->fetch_array($birthdays))
{
    
$username unhtmlspecialchars($userinfo['username']);
    eval(
fetch_email_phrases('birthday'$userinfo['languageid']));
    
vbmail($userinfo['email'], $subject$message);
    
$emails .= iif($emails', ');
    
$emails .= $userinfo['username'];


so you could even do something like
PHP Code:

 $message $message "<p><a href='www.mysite.com/misc.php?do=vistedurl&$userinfo['email']'>Unsubscribe</a>" 


kh99 07-11-2012 05:07 PM

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).

kh99 07-11-2012 05:44 PM

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).

John Lester 07-11-2012 07:01 PM

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.

kh99 07-11-2012 07:05 PM

Quote:

Originally Posted by John Lester (Post 2347084)
Kevin it's not inserting the unsubscribe link on my live site

OK, I think we may have our signals crossed - this one doesn't automatically insert anything, it's just a port of the one that you liked but wasn't acceptable because of the "double opt-out" - or was it the one that required you to log in? In any case, did the previous one insert a link? Maybe I messed something up without realizing it was there.

John Lester 07-11-2012 07:12 PM

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 :(

kh99 07-11-2012 07:19 PM

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.

John Lester 07-11-2012 07:27 PM

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 :)

kh99 07-11-2012 07:33 PM

Quote:

Originally Posted by John Lester (Post 2347095)
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 :)

Yeah, a phrase or two was misnamed (I went and renamed everything because I like to add kh99 and mod name just to avoid possible comflicts). I've been working on little things like that in the current version.

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 :).

John Lester 07-11-2012 07:36 PM

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.

kh99 07-11-2012 07:40 PM

Quote:

Originally Posted by John Lester (Post 2347101)
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.

Oh, I see. Good, I'll take a look at that. Yeah, I was thinking about a set of checkboxes for what it should turn off, in the adminCP and maybe optionally on the user form (where you enter the email) so a user could decide what to opt out of.

--------------- 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.

John Lester 07-11-2012 07:47 PM

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 :)

kh99 07-11-2012 07:54 PM

Quote:

Originally Posted by John Lester (Post 2347105)
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.

Hmm...if it's important to you then I'd test that. Looking at the code, it doesn't look like that's true. In fact after a quick glance it looks like the only things affected by the admin email setting is birthday emails, infraction notices, and emails sent from the admincp (but I may have missed a few things).

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).

John Lester 07-11-2012 08:16 PM

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

kh99 07-11-2012 09:28 PM

Quote:

Originally Posted by John Lester (Post 2347113)
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

Well, in a way that would only make the situation worse, if there was a link but it didn't actually stop the emails.

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:

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

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
  • Page Generation 0.02934 seconds
  • Memory Usage 1,962KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (22)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete