Copied to clipboard

Flag this post as spam?

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


  • Rie 6 posts 26 karma points
    Nov 22, 2010 @ 10:30
    Rie
    0

    Send email from XSLT list

    Hi,

    I'm trying to send an email to a person from a XSLT list, but the problem is that when I press send, the email sends to everyone who is on the list.

    My code is:

    <xsl:variable name="settings" select="umbraco.library:GetXmlNodeById($side)" />
            <xsl:choose>
            <xsl:when test="umbraco.library:Request('SendMail')">
                <xsl:call-template name="SendMail">
                    <xsl:with-param name="Recipients">
                       <xsl:value-of select="e-mail"/>
                    </xsl:with-param>
                    <xsl:with-param name="Body">
                        <![CDATA[Hej]]> <xsl:value-of select="navn"/><![CDATA[,<br/>]]>
                       <![CDATA[Der står en ved hoveddøren, som skal tale med dig]]><![CDATA[<br/>]]>  
                    </xsl:with-param>
                    <xsl:with-param name="From">
                         [email protected]
                    </xsl:with-param>
                    <xsl:with-param name="Subject">Subject text</xsl:with-param>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <div id="kontaktformular">
           
                    <form id="book" name="book" action="">
                        <input type="hidden" name="{concat('Number',@id)}" value="t"></input>
                       
                      <button type="submit" name="{concat('Number',@id)}" class="mailKnap" value="Send" />
                    </form>
                </div>
            </xsl:otherwise>
        </xsl:choose>

     

    </xsl:template>
         <xsl:template name="SendMail">
            <xsl:param name="Recipients"></xsl:param>
            <xsl:param name="Body"></xsl:param>
            <xsl:param name="From"></xsl:param>
            <xsl:param name="Subject"></xsl:param>

            <xsl:value-of select="umbraco.library:SendMail($From, $Recipients, $Subject, $Body, 'true')"/>
            <hr/>
            <p>Thanks</p>
        

    </xsl:template>

    I tried to replace "SendMail" width {concat('Number',@id)to give the template a unique ID, for each person who was on the list - but that didn't work.

    I would really appreciate some help?

    -Rie

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies