Multiple reminder emails

scottrigby - February 13, 2009 - 19:19
Project:Signup
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:scottrigby
Status:postponed
Description

How many sites have you visited that send multiple reminders for an event (one month before, one week before, one day before - and even 1 week after)? Lots, right? It would be great to be able to do this in Drupal. This could be provided by yet another module, but I thought it would be great to slightly tweak Signup to allow this, because the functionality is basically already there. What do you think?

Over the past few days I've been working on a new feature for Signup which would allow the Signup administrator to set a maximum number of configurable reminders, instead of just one. Just like with the current single reminder, defaults could be configured (whether or not to send, how many days in advance, and email message), and these defaults could still also be overridden per-node.
The UI could be basically the same – 'Reminder email 1', 'Reminder email 2' etc.

The basic idea is to not change Signup's DB table structure, except to allow the reminder columns to accept serialized data. Then modify the reminder form in node_settings.inc to repeat to match the number of allowed reminders set in the Signup admin settings. Then tweak all places that submit the form to now serialize the multiple reminder form element data before updating the DB, and unserialize the data in all places that draw from the DB.

Additionally, it would also be great if reminders could be sent x days after the event start date (rather than only before). This configurable email reminder could allow for something like a follow up email (reminding you about the event you just went to), asking for feedback etc. The 'reminder_days_before' DB field could store negative numbers to refer to days after (like a double negative), such as '-7' for 1 week after the event (compared to '7' for 1 week before). "Thank you for coming, please consider filling our feedback form" etc. Rather than forcing people to understand and select negative numbers, a 'before' or 'after' widget could add that logic for reminders after the event.

Attaching a screenshot of the UI, and a (not yet fully working!) patch is coming next. It'd definitely be great to hear what you all think about this, and whether you think this could be a useful feature?

AttachmentSize
signup-multiple-reminders.png112.36 KB

#1

scottrigby - February 13, 2009 - 19:28
Status:active» needs work

Ok, so here's an initial patch. This isn't supposed to work yet, though a lot of it does – the defaults can be saved in admin/settings/signup, but the node-specific overrides don't yet work.

What do you think about the UI, and the feature?

And of course, feedback on what I might be doing wrong – specifically on node_form.inc (around line 51, I think I may be missing something about how this works) – that would be really great!

AttachmentSize
signup_374086_multiple_reminders.patch 12.84 KB

#2

greggles - February 13, 2009 - 20:28

This seems like a great idea to me in general.

We discussed in IRC - here is a summary of my thoughts:

1. I like the idea of sending mails after an event. I often do that.
2. I think "scheduled email" is better than "Reminder email" because a mail after the event is more likely to be a "thanks" than a "reminder."
3. I'd like to give control for the number of reminders to the user creating or editing the node - I think the UI should be something like the cck "add another field" interface though I realize that might be a separate "improve the UI" feature.

#3

dww - February 14, 2009 - 05:32
Status:needs work» postponed

I can't stand how reminder emails currently work. I haven't looked at the patch in here, but from the description of the issue, I think this is a good idea headed in the wrong direction. ;) We desperately need to address the problems I explain over at #290305: Split out email functionality into separate submodule(s) before anything like this has a prayer of landing upstream...

#4

scottrigby - February 20, 2009 - 22:41

That makes sense. In the meantime, I'd like to get this patch working against the current code (until the new messaging api or submodule solution is further developed). Here is a more developed patch, with help by Jamie – it now successfully saves multiple reminders serialized into the DB, and unserializes the info as needed when retrieving from the DB. The main thing this patch does not yet do is loop through the multiple reminders in cron.inc (still assumes there is only 1 reminder there). So that will need to be modified for this patch to work against the current code - Next installment :)

AttachmentSize
signup_374086_multiple_reminders_0.patch 14.17 KB

#5

stBorchert - March 2, 2009 - 15:06

Just a quick note without deeper thinking on it: isn't it possible to send this type of mails with rules? Especially scheduled rules.
So maybe its better to add rules integration and provide some default rulesets ("send mail x days before [field_start]", "send mail x days after[field_start]", etc.). So you are not limited to a fixed number of reminder or information mails.

thoughts?

Stefan

#6

darsic - March 16, 2009 - 19:27

Great idea ... thank you for this patch.
Is there any chance to make this patch 100% working?

Thank you.

#7

scottrigby - March 22, 2009 - 14:29
Assigned to:Anonymous» scottrigby

@stBorchert: That's a good idea -- though for our needs, we want users to be able to set up multiple reminder emails without having to become trained Rules users, or to have access to the power that comes with the ability to create Rules. For instance, with our approach (like the original feature in Signup) a particular role can have permission to create and manage their own Signup-enabled events, and they can also send a set number of emails to anyone who signs up to their event (a max number set by the site admin, to avoid giving the power of spam, and to simplify the interface for now -- i definitely agree with greggles that an 'Add new' option, similar to multiple cck fields, would be a great UI improvement).

@darsic: we have a working version now, that sends emails appropriately for multiple reminders (before *or* after the event start date). Actually, as greggles also pointed out, 'Reminders' is no longer the best term -- we've changed it to 'Scheduled messages' (rather than 'Scheduled emails', in favor of the more general term). It sounds like eventually this could be handled by the Messaging module, so this was another reason we went with 'Scheduled messages' in our current version.

But also, after talking this over with dww & EclipseGc at Drupalcon, our approach had to be completely reworked anyway. The serialized data approach (cool as it is!) was dropped -- instead we've needed to make a new table {signup_scheduled_messages} which allows a new row for each Scheduled message.

In the next week or so I'll be re-rolling a new patch with our changes against 6--1 (as soon as possible, but we have some other work to do between now & then), and I'll add it here for feedback :)

#8

scottrigby - April 3, 2009 - 20:30

Well, we took slightly longer than a week, but here's a working patch (also worked on heavily by JamesBarger). Aside from what's mentioned farther above, a few other adjustments were made, like placing Scheduled messages in a fieldset (because the repetition of scheduled message forms could get kind of eye-blurring, especially since these forms already look a lot like the confirmation message form!), and some text changes here & there to make it more understandable. So far it seems to work well for us, though it would be great to hear any feedback.

AttachmentSize
signup_374086_multiple_reminders_1.patch 30.96 KB

#9

scottrigby - April 6, 2009 - 15:59

@dww: referring to #3 above, do you think this could fit with what you describe in this comment from that issue?
http://drupal.org/node/290305#comment-1226604

We could still move the existing email code out into submodules that also implement the appropriate hooks, e.g. signup_reminder.module, etc, for folks that don't want all the complexity (and power) of the entire notifications framework.

With the patch in #8, the signup reminder columns are moved into a new table (though the data isn't literally moved with this patch yet) -- from your comment it sounds like this would be better as it's own signup sub-module (signup_scheduled_messages.module)? I just want to check in with you about that, and see if you have any advice for the best way to go about this if you think it's the best direction.

I'm also curious about the upgrade path - should that be built into this patch (or wait for until it's closer to a solution that you'd consider)? If so I have a question about how to handle the moved columns, similar to miki's comment here: http://drupal.org/node/290305#comment-1238871

#10

Apollo610 - April 15, 2009 - 13:52

Subscribing - great idea, as I'm looking to implement multiple reminder X DAYS and/or x HOURS...

Just wanted to confirm that any patch/enhancement will include the hours option as well? (ie, receive a message that the poker match you signed up for starts in 6 hours).

Thanks for your work guys!

#11

scottrigby - April 15, 2009 - 15:37

@Apollo610: currently the only option is days, but this could probably be made configurable without too much difficulty i assume. Maybe a separate issue though.

@darsic & everyone: BTW, for the cron to fully work there's a few more changes needed in includes/cron.inc (Joining the new table & changing those columns names form reminder to message) & includes/date.inc (just changing which table is looked in). I'll post these changes as a patch once we've got everything working properly. The holdup is we have had deadlines, and merged functionality from a few different patches. I'll have to go back and separate those changes to make a new patch against the current Signup 6.x-1.x.dev. Soon! :)

#12

juicytoo - November 8, 2009 - 10:11

Hi scottrigby,

Thanks for this.

I have a situation where I don't have start dates. I use signup for classroom registration.

But I would like to use the reminders to get users to update their registered interest in the signup.

Can I still use this patch?

Ideally, rules integration would be perfect for me, that way I can setup my own schedule events.

Is there someway someone can roll a patch for rules integration. I am happy to fund $100 towards this if it helps. If sure others might want to contribute to this.

Specifically so that I can send emails out to the users after 30 days of signup and then possibly cancel signup upon 60 days if no response of follow up resulted.

thanks in advance.

 
 

Drupal is a registered trademark of Dries Buytaert.