Please see: http://screencast.com/t/gnIusMuWSykY

When entering the email recipient, only the email address is permitted, not the name. For example:

joeschmoe@mydomain.com is ok, but
"Joe" <joeschmoe@mydomain.com> is not accepted.

Comments

stevengraff’s picture

I need this, but... not much demand for this function among the greater drupal community I suppose...

quicksketch’s picture

Version: 7.x-3.18 » 7.x-4.x-dev
Category: support » feature
Priority: Normal » Minor

Hi there, sorry sometimes it takes a *really* long time for me to get through all the issues in the Webform queue. Some slip in the cracks like this one. I've moved this to a feature request, as it should be possible for Webform to support this functionality. I think it's just not supported because not many people are aware of the longer format (at least site administrators). Considering this is the first request I've ever seen for this functionality, it doesn't seem like it's a highly demanded feature. Nonetheless I think we should keep this open as a potential feature to add. Seems like it wouldn't be too difficult to support, we'd just need to build a more elaborate validation function most likely.

stevengraff’s picture

Thanks for considering this. I was hoping it might be simple, since there is already the provision to this on the "Email from" side of the house, i.e. fields for "E-mail from address" and "E-mail from name" in the E-mail header details section under Edit E-mail Settings.

danchadwick’s picture

Issue summary: View changes

Seems reasonable. Anyone want to make a patch?

danchadwick’s picture

Priority: Minor » Normal
Status: Active » Fixed

I spent a few days straightening out the e-mail code, which had gotten rather messy over the years. This is a big patch. My strategy was to create some powerful, flexible utilities and then just call them from the various places where e-mail parsing, validating, and formatting is needed.

webform.module

  1. webform_format_email_address now handles select component e-mail mapping. It also consistently returns an array of e-mail when multiple is allowed, eliminating testing of the result by the caller and simplifying processing.
  2. webform_email_validate is a form validation function which sets consistent form errors for e-mails are invalid, missing (when required), or multiple (when not allowed).
  3. webform_valid_email_address is similar to the PHP valid_email_address, except that it accepts multiple address, optionally with long format addresses, such as "Some Name" <some_name@example.com". It returns FALSE if an address is invalid, or the number of valid addresses.
  4. webform_parse_email_address separates short and long format address into a name and address component.

webform.email.inc

  1. webform_email_form uses the new format utility to display the form.
  2. webform_email_address_validate uses the new validation utility to validate an entered address.
  3. webform_email_edit_form_validate validates the email add/edit form using the new validation utilities.

webform.pages.inc

  1. Removed some vestigal code left over from when e-mails were moved to their own tab.

webform.submissions.inc

  1. webform_submission_send is now much simpler. It uses the formatting utility for the from and to address(es), and the new parse utility for the Reply To header. A lot of repeated code was removed.
  2. webform_submission_resend uses the new formatting and validation code. Also, the message when an e-mail is invalid is now "(empty or invalid)" rather than "(empty)".

As a consequence of this, multiple TO addresses may be used in the e-mail configuration, and they may be long format. Note that this issue does not address the contents of an e-mail component. There is a distinct issue for that.

Committed to 7.x-4.x and (amazingly) 8.x.

  • DanChadwick committed 8e40235 on 8.x-4.x
    Issue #1873498 by DanChadwick: Email cleanup, permit long-format names,...
danchadwick’s picture

An additional change, probably a regression. When the To address is empty, don't attempt to send the message.

Committed to 7.x-4.x and conflict-resolved to 8.x.

  • DanChadwick committed 100b00b on
    Issue #1873498 by DanChadwick: Fixed attempting to send to an empty...

  • DanChadwick committed ffc2062 on
    Issue #1873498 by DanChadwick: Fixed attempting to send to an empty...

Status: Fixed » Closed (fixed)

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