- Issue created by @guenole
- Issue was unassigned.
When the spool storage is getting the emails to send, there is no way to modify the the list of email to get according custom rules.
But it could be interesting to expose the query in order to allow a developer altering the list of emails on the fly for some contextuals reasons or identified rules.
In my particular case I have to reorder the email sending list following a strict priority list of email stored in a dedicated field.
In this specific example I would like to alter the query in this way :
$query->leftJoin('simplenews_subscriber__field_priority', 'priority', '[s].[snid] = [priority].[entity_id]');
$query->orderBy('priority.field_priority_value', 'DESC');
Adding a tag to the select query (for example simplenews_mail_spool) could allow another module to override the email select query as his need.
/**
* Implements hook_query_TAG_alter().
*/
function hook_query_simplenews_mail_spool_alter(AlterableInterface $query) {
$query->leftJoin('simplenews_subscriber__field_priority', 'priority', '[s].[snid] = [priority].[entity_id]');
$query->orderBy('priority.field_priority_value', 'DESC');
}
Active
4.0
Code