[2.0.21] email posts or messages to combinations of groups

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
28
70%
Very Good
9
23%
Good
1
3%
Fair
2
5%
Poor
0
No votes
 
Total votes: 40

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28019
Joined: Sat Aug 16, 2003 7:36 am

[2.0.21] email posts or messages to combinations of groups

Post by Extensions Robot » Mon Oct 11, 2004 1:08 am

MOD Name: email posts or messages to combinations of groups
Author: asinshesq
MOD Description: This mod allows the admin or moderator (and other users authorized in the ACP to use this feature) to email posts or mass emails to the members of one or more groups (any combination is ok) or to all active users.
Whenever the admin or moderator (or authorized user) posts a post, he can check off a new option to email the post; if he checks off that option and submits the post, a new screen comes up allowing him to check off whichever groups he wants to email...when he then clicks 'send', the post (including the message in the post if he wants to include the message) gets emailed to those group members (the RE of the email will be filled in to read the same as the subject line of the post being emailed, but the sending user can change that to anything he wants; if he leaves that line blank the RE will get filled in to read "Important Announcement").

Similarly, when the admin sends an email using mass_email in the ACP, that same new screen comes up allowing the admin to check off whichever groups should receive the email.

To deal with ISPs that prohibit emails addressed to more than a certain number of addressess, also 'chunks' emails into separate batches, each with no more than 100 addresses. The admin can turn chunking off or change the maximum number of addressees by changing the appropriate lines in the code.


MOD Version: 1.1.17 (Updated 06/25/06)

Download File: email_posts_or_messages_to_combinations_of_groups_1-1-17a.zip
mods overview page: View
File Size: 88629 Bytes

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:30 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric » Wed Oct 27, 2004 4:24 pm

MOD Validated/Released

Notes:
This MOD makes it so you can mass email multiple groups at a time instead of just one. It also splits the job up by sending to only 100 addresses at a time.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Wed Oct 27, 2004 5:16 pm

Thanks for validating, guys.

This mod allows the admin to check a checkbox when he is posting that will cause an email notification of the post to be sent to any combination of one or more groups he selects (or all active users); if an admin chooses to do that with a post, he then has the option to include the text of the post in the email or not.

The mod also gives the admin the ability to send mass emails to more than one group at a time using the regular mass email function in the ACP.

[edit: this mod will not install properly on a board that has ptirhiik's category hierarchy mod installed. If you have category hierarchy installed, see http://ptifo.clanmckeen.com/viewtopic.php?p=25827#25827 for what to do.]
Last edited by asinshesq on Fri Jun 02, 2006 2:32 pm, edited 4 times in total.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Wed Oct 27, 2004 6:23 pm

Murphy's law at work again...There is an author's note in this mod that talks about what happens if your ISP limits you to a certain number of bccs per email and says that the mod doesn't deal with that problem. That note is left over from an earlier version. This mod in fact does fix that problem by 'chunking' emails so that if you have more than 100 bccs the email will go out in batches that each have no more than 100 bccs. So, you can ignore that author's note.

If you want to turn that feature off or change the 100 bcc limit to another number, just search for 'chunk' in the mod file and you will see comments that explain exactly what to do (but keep in mind that the chunking code comes up more than once in the mod so make sure you find all the places where the word 'chunk' appears).

blowfish
Registered User
Posts: 63
Joined: Sat Sep 06, 2003 11:09 am

Post by blowfish » Wed Oct 27, 2004 11:30 pm

Excellent sounding mod will be great for gaming clan forums wanting to notify members of wars, I havn't had a chance to test but i have a few quick questions.

1. Can you allow other specific users access to this feature without opeing the entire admin.

2. This mod won't allow you to send HTMl emails will it. this could maybe be a future update ;), if not anyone know a mod that might work with it.

Thanks
Regards
Brett

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Thu Oct 28, 2004 1:21 am

blowfish wrote: Excellent sounding mod will be great for gaming clan forums wanting to notify members of wars, I havn't had a chance to test but i have a few quick questions.

1. Can you allow other specific users access to this feature without opeing the entire admin.

You would have to tinker with it but the tinkering would be very very easy. There is a place in the mod where it turns on a switch to allow the right to mass email if the user is the admin; all you would need to do is to change that code so that if the user was the admin OR the user had a user_id of ___ [fill in the blank] he would have the right. You could also open this up for everyone by changing the code so that the switch was always on - that would be easy too - but it seemed to me that you wouldn't necessarily want everyone on your board to be able to mass email to everyone.

To be more specific, if you want to allow a specific user other than the admin to have the option to email to groups, do this:

Code: Select all

OPEN
posting.php

FIND
// start mod email to designated groups
//	the following code adds a checkbox option in new posts for the admin only

if( $userdata['user_level'] == 1 )
{
	$template->assign_block_vars('switch_mail_to_enabled_groups_checkbox', array());
}

// end mod email to designated groups
Now change the line that reads: if( $userdata['user_level'] == 1 ) so that it instead reads:
if( $userdata['user_level'] == 1 or $userdata['user_id'] == [fill in the user_id of the user you want to allow to email to groups] )

If instead you want to allow all users to have this option, delete the if statement and the open and close curly brackets from the code block I quote above and you should be all set.

It is also possible to change things so that users in a particular usergroup would have the option to email to groups...but that is a bit more involved and since that's not useful for my board I doubt I'll get around to doing that. [edit...I have now done this...see a few posts down from here...]

If anyone wants to take a crack at that, the code block I quoted above is the key...all you need to do is to write some code figuring out whether tthe user in question is in fact authorized to email and, if so, run the $template->assign_block_vars etc. line.

I guess the nicest way to do it would be if there were a checkbox in the group management (admin_groups) page for each group that would allow the admin to designate whether members of that group would be entitled to do mass emails; if yes, a column in the group db for that group would be set to 1; then in the code block I quote above there would be code to check whether the particular user was a member of a group that had that column set to 1; if so (or, for that matter, if the user is an ADMIN), the $template->assign_block_vars etc. line would get run.

In fact, you could do the same thing for particlar users too...in the user management page you could add a checkbox that allows the admin to decide whether the user would be permitted to mass email. But this is probably wasted, since if you have already done the group thing the admin could set up a group solely for users who can mass email, and then there's no reason to designate particular users separately.

2. This mod won't allow you to send HTMl emails will it. this could maybe be a future update ;), if not anyone know a mod that might work with it.

Nope, sorry.
Last edited by asinshesq on Sat Oct 30, 2004 9:51 pm, edited 1 time in total.

blowfish
Registered User
Posts: 63
Joined: Sat Sep 06, 2003 11:09 am

Post by blowfish » Thu Oct 28, 2004 8:43 pm

THanks for the prompt reply

As I am only new to PHP and MYSQL it might be beyond my skills, but thanks for pointing me in the right direction - it is somthing I can test myself with. :) will give it a go anyway.

And I like the group idea more as most of the levels of users in my forum are set by groups.

thanks
B
Regards
Brett

blowfish
Registered User
Posts: 63
Joined: Sat Sep 06, 2003 11:09 am

Post by blowfish » Thu Oct 28, 2004 8:48 pm

oops double post
Regards
Brett

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Thu Oct 28, 2004 8:58 pm

Tell you what. I won't be using a group feature so I don't think I'll go through the hassle of coding for a nice interface that allows you to turn on or off the option for any group. But if I get a chance over the next few days I'll post some code that would replace the stuff I quoted in the prior post and that would allow you to specify the group_id's for any groups you want to give the option to.

blowfish
Registered User
Posts: 63
Joined: Sat Sep 06, 2003 11:09 am

Post by blowfish » Thu Oct 28, 2004 9:28 pm

Sweet, that would be great, but no preasure - if you get the urge no problem but otherwise not a prob if it doesn't happen :D.
Regards
Brett

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Fri Oct 29, 2004 12:08 am

OK, blowfish, give this a try.

[edit: I have deleted the code that was originally here because that has been replaced by the code I put in the next post...]
Last edited by asinshesq on Sat Oct 30, 2004 6:58 pm, edited 1 time in total.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Oct 30, 2004 6:57 pm

OK, blowfish (and others), I did a formal 'mod-to-the-mod' which can be installed with easymod. (Note that the 'mod to the mod' requires an additional DB table lookup to figure out whether a given user has that power and so that will slightly slow down a large board, but that shouldn't be a big deal). Anyway, here it is:

[edit: I have now included this 'mod to the mod' in the zip file that you can download from the link in the first post in this thread so I have deleted that code here]
Last edited by asinshesq on Fri Dec 03, 2004 3:04 am, edited 2 times in total.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Oct 30, 2004 9:15 pm

I just posted in the preceding post a new version of the 'mod to the mod' that gives you a checkbox option when you edit a group in the ACP to enpower the users in that group to email posts to groups. Blowfish, let us know how this works for you.

And I would be interested in finding out from the peanut gallery whether people think I should fold this 'mod to the mod' into the basic mod and get that re-validated or whether most people will only want the admin to have the capablity and won't want to add the extra DB lookup that this mod to the mod does.

rseoane
Registered User
Posts: 2
Joined: Sun Nov 07, 2004 9:49 am

Excuse my language, but I'm spanish

Post by rseoane » Sun Nov 07, 2004 10:00 am

I just install your "mod to mod" and works fine. I think that is a great idea that you write a basic mod with it.

I needed something like this mod to use the forum as newsletter for some groups, with the advantage that users may reply them. :D

Thanks.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sun Nov 07, 2004 12:25 pm

rseoane, it probably woudn't be that hard to rig things so that users in the groups given the power to email posts could also be given the power to go into the mass mail panel in the ACP to send a mass email...if you want that feature and feel like doing a little programming, pm me and I'd be happy to point you in the right direction.

As for whether to include the mod to the mod in the basic mod, I'm still reluctant. What I'm thinking now is that I should validate the mod to the mod as a separate part of the mod that I would include with the basic mod as a separate file for people who want the feature. That way, people who don't want the feature don't need to take whatever performance hit (however small) the additional db lookup takes for each and every post and only need to add one rather than two new columns. The 'cost' of my approach is that when someone wants the added feature, he will need to add the mod to the mod as a separate mod, but I don't think that takes too long (and with the great easymod it takes no time at all!).

Reactions before I go down this path?

Post Reply

Return to “[2.0.x] MOD Database Releases”