It would be nice to be able to send a broadcast email targeted to registrations in different states. For example, if you have a pending state that's waiting for the registrant to do something, you could send a broadcast email to all users in the pending state telling them you're waiting for them. Or if you have a state like "attended" that you're using to track attendance, you could send a followup email with a post-event survey and be sure it's only going to those who you've marked as having attended.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

cboyden created an issue. See original summary.

cboyden’s picture

Status: Active » Needs review
StatusFileSize
new2.93 KB

I've attached a patch which adds a field on the Email registrants page where you can select the registration states you want to send the email to. If the broadcast is sent from another function - for example, the reminder function - it defaults to the active states, same as before.

dsnopek’s picture

This looks great! I just have one small bit of review:

+++ b/includes/registration.forms.inc
@@ -404,6 +408,15 @@ function registration_registrations_broadcast_form($form, &$form_state, $entity_
+  $form['statuses'] = array(
+    '#title' => t('States'),
+    '#type' => 'checkboxes',
+    '#description' => t('Select registration states of registrants to send the message to.'),
+    '#options' => $statuses,
+    '#required' => TRUE,
+  );

To maintain the old behavior without requiring users to do something new, this should probably set #default_value to the active statues. That way they can just hit send to e-mail the people who are attending without having to select anything.

cboyden’s picture

StatusFileSize
new3.79 KB
new2.4 KB

Thanks, @dsnopek. I'm attaching a new patch and interdiff. In this patch I've set the default value of the form field to the active states. I've also tweaked the check for active states in the registration_send_broadcast function. If the site admin has chosen to send a broadcast message to specific registration states, the system shouldn't disregard that choice and not send the mail if there are no active states configured.

cboyden’s picture

If you happen to be using the patch in #1927524: Change admin menu structure for registration types to allow for panelizer integration (as I am), the patch above will not apply. I'm attaching a patch that will apply after that one has been applied. I'll hide it so it doesn't appear in the issue summary area.

drnikki’s picture

Can confirm this works beautifully. Thanks so much. I love it when I need something and end up not having to write it myself.

Edited to add: Used patch-4. Not the reroll for those with other patches applied.

asrob’s picture

Status: Needs review » Reviewed & tested by the community

RTBC'ed based on drnikki's and cboyden's comments.

redeight’s picture

Would be nice to see this in 7.x-2.x

john.oltman’s picture

Version: 7.x-1.x-dev » 3.1.x-dev
Status: Reviewed & tested by the community » Active

Setting to Active as this would be a nice feature for the 3.1.x branch

dgwolf’s picture

Seconded. I'd have use for sending messages to those on the waitlist.

socialnicheguru’s picture

Status: Active » Needs review
john.oltman’s picture

Status: Needs review » Active

There are no patches or merge requests for the 3.x version to review yet. Setting back to "active".

socialnicheguru’s picture

sorry the patch above was for Drupal 7.

john.oltman’s picture

Version: 3.1.x-dev » 3.3.x-dev
dgwolf’s picture

Surely an additional field for a configurable default email address would make sense to which a copy of the mail to the recipient group gets sent for later reference and archiving, ideally with the group's status and "Sent" date in the title added at the time when the mail was sent, perhaps in brackets, and an attached list of the recipients.

  • john.oltman committed 7bc58505 on 3.3.x
    #2571069: Broadcast email to registrants filtered by registration state
    

  • john.oltman committed 3ec2cf08 on 3.1.x
    #2571069: Broadcast email to registrants filtered by registration state
    
john.oltman’s picture

Status: Active » Fixed
john.oltman’s picture

Good to hear from you again @dgwolf! Great idea on the summary email - can you open a new issue for that. Thanks!

Status: Fixed » Closed (fixed)

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