Problem/Motivation

It looks like there are two fairly independent issues raised here:

  1. Requesting ability to send to multiple email addresses from one reminder. (Allow multiple email addresses in the field. Expand size of the field.)
  2. Requesting ability to create (and administer) reminder for another user. In other words, the reminder would be as if it had been created by the other user.

Proposed resolution

Remaining tasks

Under discussion.

User interface changes

API changes

None anticipated.

Original report by SmokinX

As an web-admin I like to be able to sent reminders to a lot of users.

I've ran into to 2 issues:
1: I get an error when setting a reminder with more then one e-mailaddress in the to-field.
2: Even if that would work, the to-field can hold a limited number of characters.

Of course 1. is the real issue, the second is minor but worth mentioning.

Question: would it be possible to rewrite some code so it's possible to add multiple addressen? Seperated by either , or ;

Or am I doing something wrong? What am I missing!

side-note: when configuring a reminder for someone else I hoped the reminder would show up at the users account, but unfortunately, it only shows up under my account... fixing that could be another request!

Comments

dwillcox’s picture

Issue summary: View changes

Reformat using issue summary template.

dwillcox’s picture

Issue summary: View changes
dwillcox’s picture

First, a warning: Given other demands on my time (like my actual job) it would be a while before I could get to any of this.

Taking your main issue first, requesting support for sending to multiple addresses...

Well, yeah, it sounds like this would be easy. And supposedly the underlying drupal_mail() api handles this. (See the description of the $to parameter.) But I never was able to get that to work and don't know what the issue is. Date Reminder basically just passes the content of that field to drupal_mail().

See _datereminder_send_reminder() here.

As for allowing a bigger field... I don't know if it's possible to do that without making the table view really ugly. That would require some experimentation.

Hey, Drupal is open source, so feel free to experiment, and suggest a patch if you find something that works.

Some things you might try to get what you want:

  • Use a distribution list. I don't know if drupal_mail() or anything else in Drupal supports this. An externally-run email distribution list might work. (That's what I do on my own site that I originally wrote this for.)
  • Create a separate reminder entry for each recipient. Yes, I understand that that could be cumbersome if there are lots of entries.
dwillcox’s picture

Regarding being able to create and administer reminders for another user...

Yes, I see the value in this, and I had a mind to do that in the original development. But it added a level of complexity that wasn't worth the effort for me at the time. And until some free time magically appears in my schedule....

Again, open source. If anyone wanted to take this on, go for it. (Though perhaps we should talk strategy first.)

dwillcox’s picture

More on the multiple emails issue.

I went back and looked at the form validation code, and it looks like Date Reminder at least attempts to support multiple addresses. See _datereminder_form_validate_user().

So yes, the form validate expects a comma-separated list of email addresses, but as mentioned earlier, drupal_mail() doesn't seem to like it.

That still leaves the field size issue, of course.

dwillcox’s picture

Issue summary: View changes
dwillcox’s picture

Regarding issue 1:

I finally went back and tried it, and it multiple reminders seem to be handled just fine. Or at least they are if you separate the addresses by exactly a comma. I tried entering two addresses, comma separated, and they were sent just fine.

Now I'll admit, there are apparently issues if you don't do it exactly right, for example, if you separate by "comma-space." The form processing could definitely be more robust.

And the database field is limited to 255 characters, so that's going to be a hard limit without a change.

So given the first issue in the original report:

1: I get an error when setting a reminder with more then one e-mailaddress in the to-field.

How were you trying to enter multiple addresses? Were you separating by commas? Commas only? Does it work for you if you use just commas?

dwillcox’s picture

The current 7.x-1.x-dev release has some improvements in handling a list of email addresses in the reminder form. Multiple addresses still need to be separated by commas, but extra white space is stripped out. And an error has been fixed in how form errors are recorded. Feel free to try it.

Still limited to 255 characters of addresses, however.

dwillcox’s picture

The improvement to validating email addresses is in 7.x-1.7 and 6.x-1.3.

Putting off expanding the email field size for now. Doing that would require changing the database schema, which is a rather more touchy issue.

dwillcox’s picture

Status: Active » Postponed
SmokinX’s picture

Dear dwillcox,

Thank you very much for supplying a very simple alternative first (mailing-list address...;-) and after that a fix for the comma separated multiple addesses. I only used comma-space when I tested.
I will test your new code later.

For now I'm strugling with the fact that the reminder option doesn't even show up anymore because I'm using an alternative multiple data field and it looks not compatible with your module. Might even put in a new request. But first some extensive testing to do.

thanks again, SmokinX

SmokinX’s picture

Well, that last issue was quickly resolved.

Go to Administer>Content management>Content types and edit the content type. (Content type administration is under .../admin/structure/types in D7.) and use the "Select which of several date fields to use for reminders" option.

Perhaps you can add this to your description page for ease.

SmokinX’s picture

Dear dwillcox,

Everything is working now. Comma-space separated addressen get transformed to comma separated nicely. If you don't plan on fixing the 255 character limit you may close this issue of course.

best, SmokinX

dwillcox’s picture

Status: Postponed » Fixed

Well, fixed to the extent it will be.

dwillcox’s picture

Status: Fixed » Closed (fixed)