I want to save the user-list information on a per-template basis, so that I can schedule a cron to auto-email the template to the preset list of users (or rather, to the preset *selected list items* in the select-email-addresses interface)

At the moment its only possible to send a mass-mail if you use the web interface and manually submit the values, page by page. What I'd like is a 1-click process (with a confirm page, which can be bypassed) which will allow this to be automated

Comments

daniel.hunt’s picture

I've got this half working (the user-list per template thing), but for some reason, on page 2 of the "send" process it just won't appear with the checkboxes ticked by default (drupal definitely knows what should be ticked though)...

daniel.hunt’s picture

I've *finally* figured out what was causing the problem - it has to do with the multi-page form submissions.
Are you sure that you're using the multipage form submission stuff correctly? I'm going to have to go through it to check - *sigh*

daniel.hunt’s picture

Well I got around the problem by using a dirty (very, dirty) hack - I'm resetting the $_POST['send_to'] variable on every page load. In most cases it will be set to whatever it is itself, but on the first page load it needs to be set to the right values for the current template.
I'm sure there's a better way though.

daniel.hunt’s picture

I'm really spamming this issue list aren't I?

Anyway - _POST isn't used anymore, I'm updating $form['#post']['send_to'] instead.

As for the automated form submission though, I just can't seem to get drupal_execute() to work with this bloody multipart form :/

daniel.hunt’s picture

I've finished this code - because of the numbe rof (rather substantial) changes made, I won't post a patch file.

If the developer of this module is interested in what I've done I'll be happy to send on the full codebase I have here for review. No doubt there are other people who would like to see this kind of functionality.

Daniel

sime’s picture

Version: 5.x-1.0-rc2 » 6.x-1.x-dev

Thanks for all your efforts there zoro, the multi-page stuff sucked definitely. In Drupal 6 we're going to do things a lot nicer.

I'm not entirely clear on your initial requirement, though. So you want to resend the same template to the same list of users by cron, multiple times automatically?