Copied to clipboard

Flag this post as spam?

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


  • Tom Maton 387 posts 659 karma points
    Dec 20, 2010 @ 11:59
    Tom Maton
    0

    Sending email to certain email address dependent on selection in form

    HI All,

    I've got a form generated from contour but my client wants an email to be sent to a specific email address dependent on the checkbox in the form is selected.

    Does anyone know how this could be achieved?

    Thanks

    Tom

  • Ismail Mayat 4350 posts 9405 karma points MVP 2x admin c-trib
    Dec 20, 2010 @ 15:13
    Ismail Mayat
    1

    Tom,

    You on skype i did something simliar very recently

    Regards

    Ismail

  • Tom Maton 387 posts 659 karma points
    Dec 20, 2010 @ 16:26
    Tom Maton
    0

    Hi Ismail

    Yep, I'm on skype (now :)). user tom.maton1980

    Cheers

    Tom

  • Greg Smith 7 posts 31 karma points
    Feb 12, 2011 @ 15:58
    Greg Smith
    1

    Hi guys,

    Having the same issue. Could you point me in the right direction.

     

    Much appreciated.

    Greg

  • Jan Skovgaard 11242 posts 23391 karma points MVP 6x admin c-trib
    Feb 12, 2011 @ 16:02
    Jan Skovgaard
    0

    Hi guys

    Would be nice if the solution could be shared in here so others could benefit.

    /Jan

  • Greg Smith 7 posts 31 karma points
    Feb 12, 2011 @ 17:00
    Greg Smith
    2

    Hi again,

    The best I could come up with was to send an XSLT transformed email. I have the Contour form workflow set to email my own email address, then within the XSLT send an extra email based upon a field value.

    The below code would work for sending an email based on what was selected from a Dropdown List called 'Super Dropdown List'

    <?xml version="1.0" encoding="utf-8" ?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:my-scripts" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="xsl msxsl user umbraco.library">
        <xsl:output method="html" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="DTD/xhtml1-strict.dtd" cdata-section-elements="script style" indent="yes" encoding="utf-8" /> 
        <xsl:param name="records" /> 
        <xsl:template match="/">
    
            <!--Read Dropdown List Value into variable -->
            <xsl:variable name="dropdownlistValue" select="$records//fields/superdropdownlist//value"/>
    
            <!-- Read form contents into a variable ready for sending -->
            <xsl:variable name="bodyText">
                <xsl:for-each select="$records//fields/child::*">
                    <strong><xsl:value-of select="./caption" />: </strong><xsl:value-of select=".//value" />&lt;br /&gt;&lt;br /&gt;
                </xsl:for-each>
            </xsl:variable>
    
            <!-- Send email -->
            <xsl:choose>
                <xsl:when test="$dropdownlistValue = 'Option 1'">
                    <xsl:value-of select="umbraco.library:SendMail(
                        'info@umbraco.org',
                        'email@email1.com',
                        'Subject', 
                        $body, 
                        'true'
                    )"/>
                </xsl:when>
                <xsl:when test="$dropdownlistValue = 'Option 2'">
                    <xsl:value-of select="umbraco.library:SendMail(
                        'info@umbraco.org',
                        'email@email2.com',
                        'Subject', 
                        $body, 
                        'true'
                    )"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="umbraco.library:SendMail(
                        'info@umbraco.org',
                        'email@email3.com',
                        'Subject', 
                        $body, 
                        'true'
                    )"/>
                </xsl:otherwise>
            </xsl:choose>
    
            <!-- A reminder for yourself -->
            <p>Contour form submitted!</p>
    
        </xsl:template>
    </xsl:stylesheet>

     

    Hope this helps anyone that has run into this problem.

    Greg

     

  • Tom Maton 387 posts 659 karma points
    Feb 14, 2011 @ 09:46
    Tom Maton
    0

    Hi,

    I'll try and get something up in the Wiki by the end of the day of what I've done thanks to Ismail's help

    Thanks

    Tom

  • Tom Maton 387 posts 659 karma points
    Feb 16, 2011 @ 17:09
    Tom Maton
    0

    Hi All,

    I've added to the wiki -  Extending Contour, sending email dependent on form selection

    Hope this helps in what you are trying to achieve.

    Tom

     

  • Lee 26 posts 74 karma points
    Oct 03, 2019 @ 16:28
Please Sign in or register to post replies

Write your reply to:

Draft