Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Nauman 98 posts 118 karma points
    Nov 23, 2010 @ 07:18
    Nauman
    0

    send email to merchant / store owner on order placement

    Hi Soren

    I want to send the email to the merchant / store owner when an order is placed. I see that there is a built in function to send email to customer.

    How can I do the same to send the details / notification of the order in email to the store owner when an order is placed?

    Nauman

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 23, 2010 @ 10:32
    Søren Spelling Lund
    0

    On each e-mail type setup in uCommerce you have the option of configure a CC or a BCC receiver. If you use that you can send any e-mail sent to customers to the store owner as well. I see that I didn't actually include this information in my article about sending e-mail so I'll make sure to update it for you.

    If what you need is some different information in your e-mail you can configure a new e-mail type and send that whenever a customer checks out by using the SendEmail pipeline task.

    Sending E-mail using uCommerce 

  • Nauman 98 posts 118 karma points
    Nov 24, 2010 @ 13:13
    Nauman
    0

    Thanks Soren, I will try this and get back. :)

  • Nauman 98 posts 118 karma points
    Nov 30, 2010 @ 08:34
    Nauman
    0

    Soren

    I have followed the steps mentioned in your article.

    I need to ask where to add the "Send Email" xslt code

    <xsl:variable name="orderGuid" select="CommerceLibrary:GetBasket()/purchaseOrder/@orderGuid"/>
    <xsl:variable name="result" select="SendEmail('OrderConfirmation', $orderGuid)"/>

    When I put it on "SubmitBasket[XSLT].xslt" and save the xslt, it says "SendEmail()' is an unknown XSLT function".

    What else do i need to include in the xslt?

    AND will email work from "SubmitBasket[XSLT].xslt"?

    Regards

    Nauman

     

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 30, 2010 @ 11:04
    Søren Spelling Lund
    0

    To make the XSLT extension work you need this syntax (notice the CommerceLibrary prefix on SendEmail):

    <xsl:variable name="orderGuid" select="CommerceLibrary:GetBasket()/purchaseOrder/@orderGuid"/>
    <xsl:variable name="result" select="CommerceLibrary:SendEmail('OrderConfirmation', $orderGuid)"/>

    The latest versions (1.1 and up) let you send the e-mail from our pipelines, which is the easiest way to do it.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 30, 2010 @ 11:04
    Søren Spelling Lund
    0

    In fact it'll do it by default if you update to the latest :)

  • Nauman 98 posts 118 karma points
    Nov 30, 2010 @ 14:29
    Nauman
    0

    Soren

    After doing all this, i am getting xslt error on orderconfirmation page.

    By examining the log table i found following 2 enteries


    The type name UCommerce.Pipelines.Common.SendEmailTask, UCommerce.Pipelines could not be located.
    System.Type ObtainType(System.String)
       at Castle.Windsor.Installer.DefaultComponentInstaller.ObtainType(String typeName)
       at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container)
       at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store)
       at Castle.Windsor.WindsorContainer.RunInstaller()
       at Castle.Windsor.WindsorContainer..ctor(IConfigurationInterpreter interpreter)
       at Castle.Windsor.WindsorContainer..ctor(String xmlFile)
       at UCommerce.Pipelines.PipelineFactory.Create[T](String name)
       at UCommerce.Xslt.TransactionLibrary.Checkout()
       at UCommerce.Xslt.Library.<Checkout>b__36()
       at UCommerce.Xslt.Library.HandledCall[T](Func`1 method)

    Could not load type 'UCommerce.Pipelines.Common.SendEmailTask' from assembly 'UCommerce.Pipelines'.
    Void* _GetTypeByName(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef, Boolean)
       at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
       at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
       at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
       at Castle.Windsor.Installer.DefaultComponentInstaller.ObtainType(String typeName)

    Any Idea?

    Nauman

  • Nauman 98 posts 118 karma points
    Nov 30, 2010 @ 14:47
    Nauman
    0

    Soren

    There is another error displaying on "orderconfirmation" page.

    "No e-mail address specified for the current customer." The order is placed before calling email and order shows the billing email address properly.

    Nauman

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 30, 2010 @ 14:56
    Søren Spelling Lund
    0

    As for the first error the SendEmailTask is only included in version 1.1.1.0 and up so you need to make sure that you're running the latest version before using the pipeline.

    The second error is probably because you're running SendEmail after checking out. SendEmail operates on the current basket which doesn't exist after calling Checkout as it's converted to an order as part of the checkout process.

    To fix it you simply move your SendEmail call to a point before executing Checkout() in SubmitBasket.

  • Nauman 98 posts 118 karma points
    Dec 01, 2010 @ 08:20
    Nauman
    0

    Soren

    following is my submitbasket xslt.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library"
        xmlns:CommerceLibrary="urn:CommerceLibrary"
        exclude-result-prefixes="msxml umbraco.library CommerceLibrary">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">




      <xsl:variable name="isPostback" select="umbraco.library:RequestForm('submitBasket') "></xsl:variable>

      <xsl:if test="string-length($isPostback) > 0">
        <xsl:value-of select="CommerceLibrary:ExecuteBasketPipeline()"></xsl:value-of>


    <!--new section added by Nauman to send email -->
    <xsl:variable name="orderGuid" select="CommerceLibrary:GetBasket()/purchaseOrder/@orderGuid"/>
    <xsl:value-of select="$orderGuid"/>
    <xsl:variable name="result2" select="CommerceLibrary:SendEmail('OrderConfirmation', $orderGuid)"/>
    <xsl:value-of select="$result2"/>



        <xsl:variable name="resultn" select="CommerceLibrary:ExecuteBasketPipeline()"/>
        <!--<xsl:variable name="addressResult" select="CommerceLibrary:SetBillingAddress('Billing')"></xsl:variable>-->
        <xsl:variable name="result" select="CommerceLibrary:Checkout()"></xsl:variable>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>

     

    On orderconfirmation page, i still get the message "No e-mail address specified for the current customer."

    Any idea, whats wrong in above code?

    Nauman

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 01, 2010 @ 09:13
    Søren Spelling Lund
    0

    You need to move the SetBillingAddress() call before the SendEmail call as the e-mail is picked up from there. 

  • Nauman 98 posts 118 karma points
    Dec 01, 2010 @ 14:01
    Nauman
    0

    OK, i did that and new exception is thrown while saving xslt.

    System.Xml.Xsl.XslTransformException: Extension object 'urn:CommerceLibrary' does not contain a matching 'SetBillingAddress' method that has 1 parameter(s).

    I had commented this line and now removed the comments from it and it is throwing exception.

    any idea?

    Regards

    Nauman

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 01, 2010 @ 14:46
  • Nauman 98 posts 118 karma points
    Dec 02, 2010 @ 06:27
    Nauman
    0

    Sorry Soren, i did not understand.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 02, 2010 @ 09:52
    Søren Spelling Lund
    0

    The XSLT extension you're trying to call (SetBillingAddress) doesn't exist in the uCommerce API. The extension you want is EditBillingInformation which will updates the address information and sets the address on your basket.

    The link shows you might arguments it expects.

  • Nauman 98 posts 118 karma points
    Dec 02, 2010 @ 12:41
    Nauman
    0

    Soren

    Sorry to bother you again. I have folliwng xslt

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library"
        xmlns:CommerceLibrary="urn:CommerceLibrary"
        exclude-result-prefixes="msxml umbraco.library CommerceLibrary">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
      <xsl:variable name="isPostback" select="umbraco.library:RequestForm('submitBasket') "></xsl:variable>

      <xsl:if test="string-length($isPostback) > 0">
      
    <xsl:variable name="resultn" select="CommerceLibrary:ExecuteBasketPipeline()"/>

    <!--new section added by Nauman to send email -->
    <xsl:variable name="addressResult" select="CommerceLibrary:EditBillingInformation('firstName','lastName','[email protected]','phoneNumber','mobilePhoneNumber','company','line1','line2','postalCode','city','state','attention',10)"></xsl:variable>
    <xsl:value-of select="$addressResult"/>

    <xsl:variable name="orderGuid" select="CommerceLibrary:GetBasket()/purchaseOrder/@orderGuid"/>
    <xsl:value-of select="$orderGuid"/>
    <xsl:variable name="result2" select="CommerceLibrary:SendEmail('OrderConfirmation', $orderGuid)"/>
    <xsl:value-of select="$result2"/>
      
        <!--<xsl:variable name="addressResult" select="CommerceLibrary:SetBillingAddress('Billing')"></xsl:variable>-->
        <xsl:variable name="result" select="CommerceLibrary:Checkout()"></xsl:variable>
      </xsl:if>
    </xsl:template>
    </xsl:stylesheet>

    I am getting again "No email set for current customer". Your thoughts on this please?

    Nauman

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 02, 2010 @ 13:40
    Søren Spelling Lund
    0

    Which uCommerce version are you running?

  • Nauman 98 posts 118 karma points
    Dec 02, 2010 @ 13:47
    Nauman
    0
    Ucommerce version 1.0.4.1
    Ucommerce Store 1.0.1.2
  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 03, 2010 @ 09:23
    Søren Spelling Lund
    0

    I didn't realize you're running an older version. The behavior of SendEmail changed slightly with newer versions of uCommerce. The version you're using will grab the e-mail address from the customer (not the billing address which is the case for the latest versions).

    To send e-mail with your version you need to do an EditCustomer along with your EditBillingInformation. That'll make it work.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 03, 2010 @ 09:24
Please Sign in or register to post replies

Write your reply to:

Draft