I have seen similar feature requests before, but this still seems a feature which has not made it into many mail modules.

This module always you to dynamically filter a newsletter's recipients when sending using the results of a view.

I have set up a sandbox here:
https://drupal.org/sandbox/dieuwe/2179443

I have had to "cannibalise" two functions from simplenews to make this work:
1. Form submit (modified to call my mail spool function instead)
2. Mail spool function (modified to use the SelectQuery generated by the view)

Would appreciate any feedback on whether you think this is a good approach and if this functionality should remain separate or be integrated into simplenews. I have one project I am working on which requires this feature and another coming up with probably will too, so I will be updating the sandbox as often as I can.

(I have been working with simplenews 1.x, have not had a chance to check out the 2.x branch)

Comments

Berdir’s picture

See #1884290: Implement a pluggable system for who emails get sent to, work went into 7.x-2.x to provide an API for such use cases. The party CRM project is AFAIK relying on that.

dieuwe’s picture

Thanks, will take a look at supporting the 2.x branch.

I don't know if this is the place to ask, but what is the state of simplenews 2.x? Release plans, etc? Just wondering if it's worth switching to that for new projects or if there is no way that branch will work on a live site in the foreseeable future. Couldn't find much from scanning the issue queue.

dieuwe’s picture

Just spent a little while examining the code while starting the conversion work, and the 2.x recipient_handler plugin stuff looks great :) Nice work.

I should have my views handler plugin "ready" within 2 weeks as I'm on holiday next week.

Just wondering, is this something you would like to keep in a separate module or should I attempt to contribute a views plugin handler as a patch?

dieuwe’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

I have a working 7.x-2.x branch on my sandbox, I would appreciate it if anyone could take a look and give me their thoughts on the project.