This doesn't seem to work. Here's what I've done.

1. I've set the Mass Contact to only allow 2 emails per hour (for testing purposes).
2. Sent the email off and it added it to the Job Queue.
3. When I go to: /admin/reports/job_queue I get:

* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.

4. In /admin/reports/status, I see Job Queue (9 jobs), however all of them have the same time:

Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail

5. If I run cron.php manually, all 9 jobs are sent, when it should only be sending 2 per cron run.

Am I missing something?

Comments

everydayjones’s picture

Also, in admin/settings/job_queue it says:

Job queue
Job type Priority
All other functions 0

Shouldn't it show the Mass Contact priority here?

everydayjones’s picture

Furthermore, when cron fires, it sends all emails. It doesn't send the 2 per hour.

oadaeh’s picture

Title: Patch for send mails with job_queue (not working) » Mass Contact does not work with Job queue
Category: bug » feature

This module does not use the Job queue module. According to the Job queue module's main page:

This module is used by modules to queue function calls for execution on cron. The job_queue_add() function is used by modules to add a job to the queue:

I don't use the job_queue_add() function. If you wish to supply a working patch adding that functionality to Mass Contact, I will look at adding it.

Also, your errors appear to be from the Job queue module, not the Mass Contact module, so you should ask over there about them.

rsantiag’s picture

Hi Jones,

Look at this issue:

http://drupal.org/node/373882

You have to modify one line on jobqueue module ...

For me it's working fine.

Hope I can help you.
Ricardo

everydayjones’s picture

oadaeh - As you can see, rsantiag applied a patch for it to work with job_queue:
http://drupal.org/node/373893

everydayjones’s picture

rsantiag - I applied the fix to line 109, yet I still have the same errors and all 5 job queues will fire at the same time:

Created Description
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail

oadaeh’s picture

@everydayjones: rsantiag created the patches necessary to get Mass Contact to work with Job queue. As Mass Contact officially stands, it does not support Job queue, and as such, neither do I. I suggest you comment on rsantiag's post where the patches are listed, instead of creating a new issue.

everydayjones’s picture

Would be great if you could support it. It's a vital function for those behind server limits.

oadaeh’s picture

Status: Active » Fixed

This, or something like this, has been added to the 7.x-1.x branch using the Drupal Queue API, and the 6.x-1.x branch using the Drupal Queue module (https://drupal.org/project/drupal_queue).

Look for the changes in the 7.x-1.x-dev tar.gz file dated after 2013-Jul-03, and the 6.x-1.x-dev tar.gz file dated after 2013-Mar-09.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.