3

I have a website where a user can send out emails from. I have kind of mimics basic form with:

To: <Text Input>
Subject:<Text Input>
Attachments: <Button> <Text Input>
Body <input text>

I have a list of email address in a database table and it's easy for me to retrieve this. I am trying to find the slickest way to support the following use cases:

  1. Allow users to send email to everyone in list.
  2. Allow users to select specific members of group

What would be a good way to do this? Do some code samples exist?

One way I thought of is to mimic Gmail when you can just start typing and it will do an inline search for emails in the list. I guess I would have a separate button to "Select All" users in this case.

That is just one idea. I am open to suggestions.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
leora
  • 188,729
  • 360
  • 878
  • 1,366

3 Answers3

2

The jQuery plugin I referenced in my answer below has been replaced by a jQuery UI component.


I'd definitely recommend the autocomplete approach. Something like this jQuery plugin would be a good start. You'd need to modify the code to treat commas as a trigger for a new autocomplete search though.

As for the all members, yup, an "All Members" checkbox seems the most straightforward. If you wanted, you could also include keyword triggers in your To field processing so that words like "All" or "Everyone" would be equivalent to selecting the checkbox.

Edit: jQuery is one step ahead of me and the autocomplete plugin already supports multiple entries:

$("#suggest3").autocomplete(cities, {
    multiple: true,
    mustMatch: true,
    autoFill: true
});
Pat
  • 25,237
  • 6
  • 71
  • 68
  • 1
    Any suggestions on how to modify the code to treat commas as a trigger for a new autocomplete search though. – leora Aug 19 '09 at 03:21
  • 1
    actually i found a good example here: http://jquery.bassistance.de/autocomplete/demo/ – leora Aug 19 '09 at 03:37
  • 1
    12 seconds before I did apparently :) – Pat Aug 19 '09 at 03:38
  • According to the plugin website, it is not longer be maintained, and the successor is the jQuery UI one: http://jqueryui.com/demos/autocomplete/ – thaddeusmt Jan 16 '12 at 16:43
1

How 'bout a simple select list. All Group1 Group2 Group3 ...

If a group is selected, load a multiple select with the group members in it.

Ryan
  • 768
  • 4
  • 15
1

I'd make 'send to all' just a checkbox, and the server determines that list (so it's not displayed client side).

With specific users, I'd allow the person who choose ID's from a list (not actual email addresses). If it's not mail client, you probably shouldn't be listen these peoples' emails publically. How you present this depends on how many people are in your database, etc. But autocomplete may be nice, or a simple tree-based selection. (Listing groups > people).

Noon Silk
  • 54,084
  • 6
  • 88
  • 105