Unfortunately that may need to be a custom workflow; i.e. "Send form to URL" would be the workflow to POST to, and the URL would be a custom surface controller that would hold all the code needed to send an email.
I managed to send e-mails to different recipients selected via dropdown.
First i set dropdown with the username portions of e-mail address before @ (support for [email protected], sales for sales @domain.com). The question title is recipient
The second step is to concatenate the form field recipient with domain in the receiver email field of workflow settings like :
{recipient}@domain.com
The form will be delivered to selected recipient.
Ps. This is meaningfull if the recipient address is one word only like career@, info@ or support@
That's an interesting workaround. Another caveat is that the email address isn't truly obfuscated--someone could probably guess the formula.
However, the [%SomeSessionOrCookieItem] string provides an avenue for both true obfuscation and flexible dropdown strings:
Your client could enter in the dropdown items however they want (even with spaces--for example "Support Team", "Human Resources").
You'd create a new template-less document type (perhaps call it "Form Settings"), and add a textarea property to it. Add a content item to your site using this doctype.
Your client would paste the same list of dropdown items into the above textarea property, pipe-delimited by their associated email addresses. Like so:
On the front end, you'd attach a javascript onchange event to the dropdown, which sends the server an ajax request containing the dropdown's selected value.
Your server code would use that value and the "Form Settings" doc to lookup the associated email address. Then your code would set the SomeSessionOrCookieItem session variable to that email address.
Then when the visitor submits the form, your workflow would use the [%SomeSessionOrCookieItem] magic string as the recipient.
Note--the pipe-delimited text area is just one quick-and-dirty way to store key/value pairs as client-editable content, but you get the gist :)
Change recipient e-mail with checkbox or dropdown
One of my client wants Umbraco Forms to send messages to different recipients (departments) with a selection of checkbox or dropdown.
I tried to set recipient addresses (e.g. [email protected], [email protected], [email protected]) and set the variable name as {recipient} in workflow.
Messages sent to the predefined addresses without problem.
The problem is client don't want to expose the e-mail addresses. He wants the dropdown to display labels instead.
Any advice?
TIA
Ps. I have UmbracoForms.Package.4.2.1 installed.
I urgently need this, for the exact same reason as OP. Client want to list departments in the dropdown, not emails (Sales, Support, HR ect.).
Surely someone must've solved this issue before? - It's a quite common case, and I'm really surpriced that Forms does not support this out of the box.
Thanks!
Unfortunately that may need to be a custom workflow; i.e. "Send form to URL" would be the workflow to POST to, and the URL would be a custom surface controller that would hold all the code needed to send an email.
I know... :(
That could work as a last resort. But it removes the possibility for the client, to make the forms without me interfering.
I managed to send e-mails to different recipients selected via dropdown.
First i set dropdown with the username portions of e-mail address before @ (support for [email protected], sales for sales @domain.com). The question title is recipient
The second step is to concatenate the form field recipient with domain in the receiver email field of workflow settings like :
{recipient}@domain.com
The form will be delivered to selected recipient.
Ps. This is meaningfull if the recipient address is one word only like career@, info@ or support@
Hope this helps.
Thanks, that could work. Do you know where I can find a list of the merge tags in Forms? For example "{recipient}".
{ } is used for {formFiedName}
[ ] is used for populating the field from page property fields [propertyAlias]
These are the ones i use.
More options can be seen on : https://our.umbraco.org/forum/umbraco-pro/contour/15471-Default-values-parameters-from-session
Hi Ole,
You can find a list of the merge tags in Forms? For example "{recipient}" here https://our.umbraco.org/documentation/Add-ons/UmbracoForms/Developer/Magic-Strings/
Hope this helps,
/Dennis
Thanks. I looked in the documentation, but didn't think to look for "Magic strings" :)
That's an interesting workaround. Another caveat is that the email address isn't truly obfuscated--someone could probably guess the formula.
However, the [%SomeSessionOrCookieItem] string provides an avenue for both true obfuscation and flexible dropdown strings:
Support Team|[email protected]
Human Resources|[email protected]
...
Note--the pipe-delimited text area is just one quick-and-dirty way to store key/value pairs as client-editable content, but you get the gist :)
is working on a reply...