Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
quicksketchI 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.
Comment #2
calbert CreditAttribution: calbert commentedI 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!
Comment #3
calbert CreditAttribution: calbert commentedComment #4
quicksketchThis 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.
Comment #5
quicksketchThis 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.
Comment #6
ransomec CreditAttribution: ransomec commentedMaybe 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.
Comment #7
DanChadwick CreditAttribution: DanChadwick commentedClosing 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.