I need to use 3 values to create the email address.

ex. value one : criticaloutage value two: Boston value three: outage@isp.com

to make criticalbostonoutage@isp.com so when the form is emailed, depending on your answers it emails the group that is responsible for answering that request.

It would be nice to have the Subject scream out the same thing, Subject: Critical Outage in Boston

Is there anyways to do this?

Comments

quicksketch’s picture

Category: task » support

I think you can set your e-mail value to "Custom" and then use tokens to construct the e-mail address. See:

#112538: Referring to user submitted values in subject
#300075: Introducing %value (previously %submitted) token to load submitted values

I haven't tried this out personally.

calbert’s picture

Priority: Normal » Major

I got this to work for the Subject, but not for the email address.. any help would be great I tried this

Here is Subject : Outage Notification for %value[state_the_outage_is_occurring_in] on %value[date__time_of_outage_reported_to_support] Status; %value[outage_status]

Works great..

Here is the email .. %email[state_the_outage_is_occurring_in]%email[severity_of_the_outage]@isp.com

I get this error ( The entered e-mail address "%email[state_the_outage_is_occurring_in]%email[severity_of_the_outage]@isp.com" does not appear valid. )

I also tried .. %value[state_the_outage_is_occurring_in]%value[severity_of_the_outage]@isp.com

Any help Please!

calbert’s picture

Assigned: calbert » Unassigned
quicksketch’s picture

Title: Use multiple values to make up email address, and subject. » Use of %tokens in custom e-mail address configurations not allowed
Component: Miscellaneous » User interface
Category: support » bug
Priority: Major » Normal

This sounds like it's a bug very, very similar to #1244072: Use of tokens in external URL redirect locations not allowed in some cases and not URL Encoded, which is pretty much the exact same problem but on a different field.

quicksketch’s picture

Issue summary: View changes

This issue probably still exists in the 4.x branch, because when we replace tokens the [submission:*] values don't exist yet. So if you try to use a submission token in your e-mail such as [submission:values:first_name]@example.com, it's not going to work because it's not going to pass the valid_email_address() check.

ransomec’s picture

Maybe on this form field submission in particular a dummy value could be replaced for any submission tokens found in this field? That way it would pass the validation check on save and subsequent uses would provide the functionality.

edit: just found a possible workaround after thinking about the above (always happens that way :). If you include a non-token character that will evaluate, it works in Drupal 7. Maybe it will work in Drupal 6? So for example instead of

[submission:values:first_name][submission:values:last_name]@example.com

use

[submission:values:first_name]_[submission:values:last_name]@example.com

It will pass the validation and correct the tokens on the real send. In D6 would look like this:

%email[state_the_outage_is_occurring_in]_%email[severity_of_the_outage]@isp.com

If this is an option it would solve the problem.

DanChadwick’s picture

Version: 6.x-3.x-dev » 7.x-4.x-dev
Category: Bug report » Feature request
Status: Active » Closed (won't fix)

Closing for lack of activity. This could be done in 7.x, but I'm not sure we want to allow this level of manipulation of the email address.

Please re-open with a patch for the current 7.x-4.x branch if you feel differently.

The 6.x branch is receiving critical bug fixes only.