Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frederik T 242 posts 373 karma points
    Sep 22, 2011 @ 15:13
    Frederik T
    0

    Sending contact form contents to user based on checkbox

    Yeah, i know its a common question, and ive searched but nothing really gave me the answer im looking for. Or rather, i dont want to admit the answers ive found are correct.

    Its just that what i want to do SEEMS very simple, so i hope the solution is equally simple.

    On a relativly simple contact form, ive placed a single checkbox, if the user checks it a copy of the form is sent to the users email entered in the form. Standard stuff.

    I can get it to work without checking the checkbox so i got that down. I cant really find anything in the standard workflows about checking checkboxes or similar. Is it possible, or am i forced to write an xslt?

    Thank you in advance.

  • Profiterole 232 posts 264 karma points
    Sep 27, 2011 @ 21:16
    Profiterole
    1

    I use an xslt for that... I'm not aware of any workflow that check a checkbox before doing something. It can probably be done with a custom workflow.

  • Frederik T 242 posts 373 karma points
    Sep 28, 2011 @ 10:09
    Frederik T
    0

    Well then it is sadly what i suspected.

    Quick question then: How do you check the values of the checkbox in the xslt?

    Either way, i have to solve this problem first before i can do anything: http://our.umbraco.org/forum/umbraco-pro/contour/24017-XSLT-transformed-Email-Expression-must-evaluate-to-a-node-set

  • Profiterole 232 posts 264 karma points
    Sep 28, 2011 @ 14:32
    Profiterole
    0

    Hi Frederik,

    In my workflow, I put an xslt transform email. It sends the email to me, so I'm warn that someone filled the form. In the xslt, I do a

    Some email formating to me...

    then :

    <xsl:variable name="emailTo" select="$recordId/fields/youremail//value"/>
    <xsl:variable name="checkbox" select="$recordId/fields/checkthisifyouwantitbymail//value"/>
    <xsl:variable name="emailBody" select="$recordId/fields/message//value"/>
    <xsl:if test="$checkbox != ' '>
      <xsl:value-of  select="umbraco.library:SendMail(mysite@myemail',  $emailTo,  'Subject', $emailBody,  true())"  disable-output-escaping="yes" />
    <xsl:/if>
Please Sign in or register to post replies

Write your reply to:

Draft