It appears that the tokens available in Workflow-ng do not include the content from the Email Field CCK module. I'm not sure if this is a function of the Email Field module, the Token module, or Workflow-ng. In any case, it would be nice to have those fields available, since Email Field includes additional validation of email addresses and other features.

If this feature request belongs elsewhere, please let me know.

By the way, thanks for the excellent module. I've only been using it for a day and I can already see that it is going to be very useful.

Comments

fago’s picture

Project: Workflow-ng » Email Field

yep, it belongs to the email module.

matt v.’s picture

Status: Active » Closed (fixed)

On further examination, I think I can get what I need by just using the standards text fields and adding some validation. Thanks!

phpgirl’s picture

phpgirl’s picture

Hey Matt,

Thanks for the workflow-ng pointer. It is EXACTLY what I was looking for.

It also looks like I was looking for the same thing in this post too...I was surprised to see that you couldn't actually send an email to the content of the cck email field type. That seems very weird to me and I'm not sure why it shouldn't be persued.

Also, can you give me an example of the "validation" code and where to put it? I guess I don't mind using the text field as an email input field, for now, but I'd like to:

a) validate the email address (and post back to submission page if failed)
b) be able to email a "return" separated list of emails (as opposed to a comma delimited one)

matt v.’s picture

phpgirl,

A) I don't have an example of the validation code because I haven't gotten around to coding that yet. However, I'd probably put it in a site-specific custom module, using the hook_form_alter function. I've found this page of notes from a Drupal Dojo session on NodeAPI to be very handy. This snippet doesn't validate email fields, but it is an example of additional validation.

function unsung_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  if($node->type == 'example_form') {
      case 'validate':
        $votes = count($node->field_nominees);
        if ($votes > 4) {
          // VALIDATION GOES HERE 
          form_set_error('field_nominees', 'Please select no more than four nominees.');
        }  
      break;
      }
   }
}

It may also be possible to add the validation in using Workflow-ng somehow, but I haven't looked into that.

B) I would guess that is going to take some custom scripting, to parse the form input. If you're using Workflow-ng, I'm guessing that would be done in one of the custom php actions.