Attached are the patches needed to use JobQueue module when send mails.

Hope you can find it interesting.
Ricardo

Comments

jcnventura’s picture

Status: Active » Needs work

In the print_mail.inc.patch, the patch is trying to change a lot of stuff just because of indentation and spacing.. Can you please change the patch so that it is only changing what needs to be changed and not stuff that will require manual attention later on when I run the coder module?

João

rsantiag’s picture

StatusFileSize
new805 bytes

Hi,

I think this is ok.

jcnventura’s picture

You re-uploaded the print_mail.admin.inc.patch.. The comment before was for the other patch.

rsantiag’s picture

StatusFileSize
new2.37 KB

Sorry!!!

This is the one you ask for..

jcnventura’s picture

Yes, exactly.. I can work with what you provided.. I see a couple of improvements that should be made (I can do them myself, no need to re-upload the patch):

1. The $path_to_this_file variable is defined, but I don't think it is necessary as drupal_mail is part of core (this maybe necessary for the D5 version of the module, however). $modinc is not even used at all.
2. The computation of the condition for using the job queue and the value of $sent_using_Job_QUEUE should be moved out of the foreach cycle, as it is wasteful doing it everytime inside the cycle.
3. The 'Queued Print_Mail Mail' is too generic for the job queue.. I would prefer something like 'print_mail from %name [%from]' to know at least what's waiting on the queue.

João

rsantiag’s picture

Great!!

but only 1 thing, If you don't use $path_to_this_file it doesn't work, because Job_Queue module will not find the print_mail() function, which is in this file and is an .inc file.

Hope this will be one of the next improvements of Print module!!

Ricardo

jcnventura’s picture

Status: Needs work » Fixed
StatusFileSize
new4.06 KB

Indeed, it has become part of the module.. As you'll see the end result is not exactly your code, but I think you'll recognize it anyway..

Thanks for providing the code!

João

Status: Fixed » Closed (fixed)

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