Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Cron Based E-Mail Sending Details »»
Cron Based E-Mail Sending
Version: 1.12, by Paul M Paul M is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.6.x Rating:
Released: 12-11-2006 Last Update: Never Installs: 159
Uses Plugins
Code Changes Additional Files Translations  
No support by the author.

This modification is no longer available or supported.

This is a 3.6 specific port of the 3.5 Modification.

In default vBulletin if you send a large number of e-mails, vbulletin either puts them in it's queue and then attempts to send them as each user visits a page, or just simply tries to send them straight away (This is the case when you use the Administrators email users inteface).

As a result of this your server can become seriously overloaded very quickly - so sending several thousand e-mails (like a newsletter) can become very difficult (hours spent clicking 'next' in the ACP) - as a result of these problems, this very simple modification was born.

This modification does two things ;

1. E-mails from the ACP inteface are sent to the mail queue, not straight to the mail system.

2. The processing of the mail queue is set-up as a vb cron item.

Obviously for this to work, you must turn on e-mail queuing in the ACP options - set 'Use Mailqueue System' to 'Yes', and 'Number of Emails to Send Per Batch' to a realistic value (based on the cron setting, as below).

There are two realisitc options for the cron job, you can either set it to run every minute, and set the items to be processed to something small (like 10), or you can do what this modification does by default and set it to run every 10 minutes, and set the items to be processed to something larger (like 100).

Remember, 10 per minute = 600 per hour, 100 per 10 minutes is also 600 per hour. The numbers really depend on how quick you want large queues processed, and how much your mail server can handle in one go.

Once working, when using the ACP mail users inteface, remember you can set it to process 9999 at once (not 500 or whatever) as the mails will now go into the queue, not be sent directly.

Note: This modification will affect any queued e-mails such as subscription e-mails. It will not affect registration e-mails as they bypass queuing anyway.


Upgrading from the 3.5 version.
If you have the 3.5 version installed then you don't need to upgrade - however if you decide to upgrade then you need to delete the current cron job in the Scheduled Tasks Manager and then import the product xml via the ACP Product Manager. The file edits do not need to be changed.


Queue Size

Antivirus has posted a nifty little addon that displays the current size of the mail queue here.




History:

v1.12 : First Release for vB 3.6.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #102  
Old 11-19-2007, 10:37 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
Quote:
If a forum were to have no visitors in say a two hour period, are missed vb cron jobs then executed? The result being that the task for this add-on may run all missed tasks and thereby possibly causing quotas to be exceeded?
Sorry, but I don't understand what you mean by this.
To re-phrase, are missed cron jobs still executed at the next opporutinty? For example, if there are no visitors for 2 hours then the (default - every 10 minutes) 'process mail queue' cron job would would miss 12 'executions' of the job. Would these missed 'executions' then all (12) be run at the next opportunity, or would the never be run.

The reason I ask is that if I were on a throttled account of say 500 emails/hour and had configured my vb system to send batches of 100 emails every 10 minutes (using this add-on) and if all 12 missed executions were run at the next opportunity, that would be 1200 emails send in a short space of time - totally trashing my 500 email/hour limit.

Clear as mud?
Reply With Quote
  #103  
Old 11-19-2007, 12:18 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, that will not happen - the cron job is only triggered once - if you have no visitors for two hours then it won't fire 12 times, just the once.
Reply With Quote
  #104  
Old 11-25-2007, 12:26 PM
laura66a laura66a is offline
 
Join Date: Oct 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
Huh ?

Can you please be a bit more specific.
Sure.

I have Cron Mail Queue installed and it was working great. I have it set to send 5 emails per minute which works fine for my site when I send out my weekly updates.

I recently changed my SMTP port setting from 25 to 587 at the request of my provider. There is a vBulletin option for this, but you also have to change SMTP_Port= in PHP to 587 as well to get it to work.

After I made the change, my last round of weekly updates went out all at once instead of 5 per minute. They all were successful, but they did go out all at once.

Laura
Reply With Quote
  #105  
Old 11-25-2007, 01:36 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The change you made cannot affect this modification in any way, maybe your e-mail server just queued them all up.
Reply With Quote
  #106  
Old 11-25-2007, 01:48 PM
laura66a laura66a is offline
 
Join Date: Oct 2006
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
The change you made cannot affect this modification in any way, maybe your e-mail server just queued them all up.
Perhaps it can't affect the mod, but the PHP change can certainly affect the way vBulletin works relative to the mod.

I did change this back to port 25 and it worked as expected sending 5 emails per minute.

Laura
Reply With Quote
  #107  
Old 12-06-2007, 10:10 AM
plothook plothook is offline
 
Join Date: Apr 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

* Clicks Mark as Uninstalled *
Just what we needed to get all our stuff out past our hosts 200 emails/hour limit @30 emails /10 minutes
Now everyone will get their daily e-mail notifications, even if it does take the system 3-4 hours to get the job done.

Thanks Paul!
---------------------------------
now if it only were truely CRON based and didn't depend on site activity, though we always get more than enough site hits to trigger things
Reply With Quote
  #108  
Old 12-26-2007, 11:15 AM
SVTCobraLTD SVTCobraLTD is offline
 
Join Date: Jul 2007
Location: PA
Posts: 841
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed using hostgator. Thank you, exactually what I needed and will be setting it to 25 emails per batch. Thanks - Nominated for mod of the month.

SVT
Reply With Quote
  #109  
Old 12-26-2007, 11:17 AM
SVTCobraLTD SVTCobraLTD is offline
 
Join Date: Jul 2007
Location: PA
Posts: 841
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Antivirus View Post
Great modification Paul, really helps with sending out emails to large amounts of members. I found myself wondering how many emails were in the queue quite often however, and I got tired of manually running a SELECT query in the console to find out how many emails were remaining in the queue... so i coded the attached add-on for your mod which adds the quantity of remaining emails in the mail queue to the AdminCP page.

You can see a screenpic of what it does in the attached "screenie.gif" image. I just thought I would share it with everyone who's using this mod, makes life a little easier.
A great addition to this great hack.

SVT
Reply With Quote
  #110  
Old 12-27-2007, 06:58 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


^
|
|
|


What (s)he said x 2 :up:
Reply With Quote
  #111  
Old 12-27-2007, 04:13 PM
Farcaster Farcaster is offline
 
Join Date: Dec 2005
Posts: 386
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have to agree. This plus the crontab based vbcron jobs is a killer combination!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:51 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06250 seconds
  • Memory Usage 2,314KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete