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

Rating:

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

IamwithChrist
Registered User
Posts: 52
Joined: Sat Oct 02, 2004 12:04 am

Post by IamwithChrist »

Most EXCELLENT Mr Alan,

Your support is absolutly amazing!

Thanks, if I can ever help you please let me know!

Mike

User avatar
vrflyer
Registered User
Posts: 503
Joined: Mon Feb 17, 2003 8:27 pm

Post by vrflyer »

asinshesq wrote: If you want, you could add a sleep function to delay successive batches at the end just before the last close brackets. That would read somethin like this:

Code: Select all

if($j = $number_batches -1)
{
	sleep(fill in a number of seconds here);
}
Note that there are similar lines that get added to admin/admin_mass_email.php so whatver changes you decide to make in includes/functions_post.php you will probably want to make there too.


One quick observation, upon embeding this code onto both files mentioned above.

When you select "All Users" from within the selection screen & you have say over 1000 users the screen will hang for at least 120sec & never goes past this screen
(if a smaller group is selected, say 25 or less then you'll get a confirmation screen of email sent successfull).

For test purposes my parameters were:

batch= 50 & sleep = 300sec.

Since my hosting company limits us to 50-emails every 5min & 200-emails in 1hr.
Always Under Construction !

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

Post by asinshesq »

vrflyer wrote:
asinshesq wrote: If you want, you could add a sleep function to delay successive batches at the end just before the last close brackets. That would read somethin like this::

Code: Select all

if($j = $number_batches -1)
{
	sleep(fill in a number of seconds here);
}
...


Typo alert: I think I meant if($j < $number_batches -1) for that first line. The idea is that there would be a delay (a sleep) after each batch except for the last one (since when you get to the last one there would be no reason to sleep anymore).
vrflyer wrote: ...One quick observation, upon embeding this code onto both files mentioned above.

When you select "All Users" from within the selection screen & you have say over 1000 users the screen will hang for at least 120sec & never goes past this screen
(if a smaller group is selected, say 25 or less then you'll get a confirmation screen of email sent successfull).

For test purposes my parameters were:

batch= 50 & sleep = 300sec.


OK, if you select a group with 25 and you have batch set to 50, that means that it never needs to sleep since there is only one batch. So it's not surprising that things work fine in that case.

If you go over 50 and hit the world of chunking (in your case, 20 batches of 50 each !), the program moves runs into the new sleep function code you stuck in there. But you said you set sleep to 300 seconds - a huge huge huge time. So very best case is the screen would hang 5 minutes per batch and somehow hang in there and keep going for 100 minutes before you ever saw the email sent successfully screen. But in the real world, I would be shocked if this would really work for you. I can't imagine your single php session will last for 100 minutes without timing out, will it? And even if it did it would take over your machine.

These problems have nothing to do with this mod...they are inherent in phpbb's mass email function and while this mod gives you a workaround from phpbb's limiation by allowing chunking, it is not a cure all.

Sounds to me like you have three choices if you are going to email 1000 people:

1. get an new ISP that at the very least does not have the 5 minute rule (which sounds riduculous to me) so that you don't need any sleep function (or at worst find one where you only need a short sleep of a few seconds).

2. set up your own private mail server on your server (which is not easy).

3. study the megamail mod that I referred to earlier (you can do a search for it on this board) and try to adapt it's batch coding (which allows you to send out some batches, do other things, and then pick up where you left off on the batches) for this mod.

User avatar
vrflyer
Registered User
Posts: 503
Joined: Mon Feb 17, 2003 8:27 pm

Post by vrflyer »

asinshesq wrote: 3. study the megamail mod that I referred to earlier (you can do a search for it on this board) and try to adapt it's batch coding (which allows you to send out some batches, do other things, and then pick up where you left off on the batches) for this mod.


I will take a look... :wink:
Always Under Construction !

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

stripping out bbcode and html

Post by asinshesq »

OK, by popular demand I have taken a first crack at the changes to this mod that are needed if you want use the 'include text' option to include the text of posts with your email and you don't want those ugly html and bbcode codes to be included:

[edit: I have deleted the code here since I have new coding a few posts down that is simpler]
Last edited by asinshesq on Sat Mar 12, 2005 11:35 pm, edited 6 times in total.

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

Post by asinshesq »

[deleted]
Last edited by asinshesq on Sun Mar 13, 2005 4:15 pm, edited 8 times in total.

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

Post by asinshesq »

[deleted]
Last edited by asinshesq on Sun Mar 13, 2005 4:16 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 »

[deleted]
Last edited by asinshesq on Sun Mar 13, 2005 4:16 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 »

[deleted]
Last edited by asinshesq on Sun Mar 13, 2005 4:17 pm, edited 6 times in total.

khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

is it posible for you to change the email subject to match the topic subject automatically?

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

Post by asinshesq »

khisanthax wrote: is it posible for you to change the email subject to match the topic subject automatically?


Sure, that's easy. Just tinker with the admin_enabled_email.tpl and admin_enabled_email_no_text.tpl files.

In each of those, do the following:

Code: Select all

FIND
Subject: Important Announcement on the {SITENAME} Forum

REPLACE WITH
Subject: "{TOPIC_TITLE}"
That will ensure the email has the same re as the topic title. If you want the email to have the same re as the subject of the post, that can be done but it's a bit more involved.

khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

that's perfect, thanks!

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

Post by asinshesq »

[deleted]
Last edited by asinshesq on Sun Mar 13, 2005 4:11 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 »

OK, for people who use like to check the option to 'include text' when they use this mod to email posts, here are the changes needed so that the ugly bbcode gets stripped from plain text email.

[edit: code deleted since it is now included in the most recent version of the mod (and there are upgrade instructions in the readme file for people using older versions of the mod). Note if you are using upgrade instructions that you need to apply the changes the readme specifies for your current version plus all the subsequent versions. For example, if you are running 1.1.7 you need to apply the changes listed for 1.1.7 plus those listed for 1.1.8 plus those listed for 1.1.8a plus the ones listed for 1.1.9.]

Sorry for the multiple drafts that I posted earlier (which I have since deleted). The reason for ditching those multiple drafts and going with the code I show in this post: I decided that it was better to add a new function to bbcode.php that does the heavy lifting for this change. The reason I did that is so that people can easily call that function from other parts of phpbb where it might be useful. For example, I am now calling that new function in search.php in place of the old code that strips out all bbcode when a user searches and specifies that results should be returned by post rather than topic; the reason this is better is that the new function (unlike the original search.php code) will assure that text in a post that is a quote from another person is clearly delineated from the poster's own text.

[edit: latest version of the new function added on March 16, 2005]
[edit: make sure you read and follow the IMPORTANT NOTE at the end of that code above]
Last edited by asinshesq on Tue Mar 22, 2005 1:47 pm, edited 7 times in total.

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

Post by asinshesq »

[edit: I just changed the code in the preceding post and it now works fine (thanks to Merlin Sythove]]

Post Reply

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