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.
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)
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.
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.
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.
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.
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
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
Thanks Soren, I will try this and get back. :)
Soren
I have followed the steps mentioned in your article.
I need to ask where to add the "Send Email" xslt code
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
To make the XSLT extension work you need this syntax (notice the CommerceLibrary prefix on SendEmail):
The latest versions (1.1 and up) let you send the e-mail from our pipelines, which is the easiest way to do it.
In fact it'll do it by default if you update to the latest :)
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
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
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.
Soren
following is my submitbasket xslt.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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
You need to move the SetBillingAddress() call before the SendEmail call as the e-mail is picked up from there.
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
You want http://www.ucommerce.dk/docs/html/M_UCommerce_Xslt_TransactionLibrary_EditBillingInformation.htm
Sorry Soren, i did not understand.
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.
Soren
Sorry to bother you again. I have folliwng xslt
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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
Which uCommerce version are you running?
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.
And this is the XSLT extension you need for that http://www.ucommerce.dk/docs/html/M_UCommerce_Xslt_TransactionLibrary_EditCustomer.htm
is working on a reply...