-
I'm trying to test form submissions, like contact pages, on my website, which is built on Orchard CMS. I want it to work so that if a specific type of email input is entered, the form sends the email to me instead of the default email set in Orchard. I've written a liquid syntax if statement in the recipients input field config, but it did not work: it returns a blank page, I guess the workflow does not continue, however when I refresh the page it says that could not send email. ![]()
The contact form is built with Workflows. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Do you see anything telling in the logs? |
Beta Was this translation helpful? Give feedback.
-
{% assign email = Request.Form.Email | strip %}{% if email == '[email protected]' %} [email protected] {% else %} [email protected] {% endif %} The issue was likely due to hidden characters, such as extra spaces or line breaks, in the Request.Form.Email value. This caused the conditional comparison to fail, even though the email appeared correct. To resolve this, I used the strip filter in Liquid to remove any leading or trailing spaces from the input value before performing the comparison. |
Beta Was this translation helpful? Give feedback.
{% assign email = Request.Form.Email | strip %}{% if email == '[email protected]' %} [email protected] {% else %} [email protected] {% endif %}
The issue was likely due to hidden characters, such as extra spaces or line breaks, in the Request.Form.Email value. This caused the conditional comparison to fail, even though the email appeared correct.
To resolve this, I used the strip filter in Liquid to remove any leading or trailing spaces from the input value before performing the comparison.