Sitecore Email Experience Manager – Getting started with EXM

Sitecore Email Experience Manager or EXM has become part of the main installation package since v9 update 1 (just like Sitecore Forms). The overall purpose of EXM is very much similar to any other Email marketing client, and that is, sending emails to your subscribers or members. In addition to sending out millions of emails, EXM can do A/B testing, supports multi-lingual campaigns, shows detailed reports and analysis of your emails and much more fun stuff. Check out a sample report below:

If you have been in digital world as a marketer or as a developer, I can assume that you would have worked in some sort of email campaign either during the strategy process or during development process.  For any email campaign, you would recognize that the 2 main things that you will need are:

  1.  Subscribers list
  2.  Email content

This post is for any one who wants to know how to create a subscribers list and start sending email content with EXM.

Installation:

As mentioned earlier, EXM will be installed as part of Sitecore 9 update 1 process. When you login to the Sitecore Dashboard, you can navigate to it via by clicking ‘Email Experience Manager‘ as shown below:

EXM Dashbaord:

The EXM dashboard uses the main area for showing detailed reports of previous campaigns as default, while the left hand column shows menu links to different functionality available within EXM dashboard:

For more details you can always refer to the official documentation. So lets begin the fun and see how can we use EXM in our to send out newsletters!.

Step 1: Create Subscribers List:

Once inside EXM, there are various options to create a subscribers list as shown below:

For demo purposes, lets assume we want to create a list from a file. Clicking on the ‘Recipient list from file‘ will open up a modal asking to upload a CSV file. The file should contain names and email addresses of recipients (a common practice in email marketing) :

For demo purposes, I uploaded a CSV file with 3 fields in this order: First Name, Last Name, Email:

The next step asked me to map the fields from my CSV file. As my CSV file had different order of fields, I mapped them through drop-downs provided in the modal box:

After mapping the field, the modal should look like this:

Once the fields are mapped, I clicked Next and EXM started to import my recipients:

Once my our subscribers list was imported, I was ready to create a my email campaign.

Step 2 – Email Campaign:

To start creating my email HTML copy, I clicked on the ‘Create‘ button again and selected ‘Regular email campaign‘ as shown below:

For demo purposes, I choose ‘Sample Newsletter‘ template. You can also choose any other templates type or import static HTML.

I entered the name ‘demo newsletter‘ and clicked ‘create‘ button:

The newsletter was created and I was presented with different options to enter information about the campaign:

I clicked on the ‘Recipients‘ tabs and selected the list that I have just uploaded:

Note: You can select more that 1 subscribers list in production environments

On the ‘Message‘ tab, I clicked on the main body area to update the body of sample news letter. It presented me with very familiar experience editor mode to update the content:

 

I added the very popular Sitecore sample image to my newsletter and clicked Save and close:

On the ‘Review’ tab, I wanted to make sure that everything I have entered is coming out correctly. So I entered my Gmail address and clicked Send button:

Boom! I got the email (Note: At this point I have already configured my SMTP settings as I will be explaining in step 3)

I also tested in an outlook client and it looked perfect!

The last step int the email campaign process is about the ‘Delivery‘, I can either click Send Message now or scheduled it at for a later stage:

That’s it, my email newsletter was ready to send to my subscribers!

Step 3 – Configuration Settings:

To configure email delivery for EXM, open web.config and look for settings “eds:define“. This could be either CustomSmtp or EmailCloud as shown below:

If you are in development, you may want to use your internal company SMTP server (like smtp.yourcompany.com). You also have the option to choose Gmail or SendGrid as they both will provide enough quotas to send your testing emails. For production purposes, it is highly recommended to use the Sitecore Email Cloud Service provided by Sitecore to comprehensively manage your email campaign. A comparison between custom smtp or Sitecore Email Cloud is given here.

Any ways back to configuration, open Website\App_Config\Sitecore\EmailExperience\Sitecore.EDS.Providers.CustomSMTP.config file and update the <smtpSettings> block as you wish. If you choose to use Gmail, your settings should look like this:

Once you have configured your settings, make sure to test them. Open content editor and navigate to /sitecore/content/email item and click on test connection. If everything has been configured correctly, you will get the OK message:

If you don’t get the OK message, check the logs for Eds.* .txt and Exm.*.txt in the Data folder.

That’s it for now! Hope you liked it and will start using it for future projects.

Thanks

Naveed.

Advertisements

Sitecore Experience Commerce 9 – A public action method ‘ShoppingCartLines’ was not found on controller

This is quick post about an error that I encountered during the checkout process using Sitecore Experience Commerce 9 storefront. The error happened as I entered incorrect Braintree sandbox account values during the installation process. The installation was successful but the checkout process didn’t work as expected.

After installation, I added some products to the cart and tried to checkout using the standard process. On the Billing Page, when I clicked on ‘Validate Payment‘ button, I received this error:

“A public action method ‘ShoppingCartLines’ was not found on controller ‘Sitecore.Commerce.XA.Feature.Cart.Controllers.CartController’.

The Billing Page:

The Error Page:

Sitecore Slack community came to help and thanks to Kautilya Prasad who suggested to check the Braintree account values. Also, Sitecore support team came back with the same answer pointing towards incorrect Braintree sandbox values. If you are seeing this error as well then it means that either you have not entered the sandbox values for Braintree account or have entered them incorrectly during the installation process.

In order to fix the issue, please:

  1. Make sure that you use valid parameters for braintree policy in the PlugIn.Payments.Braintree.PolicySet-1.0.0 config file.
  2. Make sure that valid parameters for braintree policy are bootstrapped to Global database.

Confirm values are present and correct in the config file:

Bootstrap the values to global database:

 

If your Braintree account is configured correctly, you will see ‘Credit Card‘ form next to the validate payment button like this: (which I was not seeing it during the checkout process earlier)

The Billing Page with Credit Card Info:

Hope this helps!

Thanks

Naveed

Sitecore Experience Commerce – XC9 – Troubleshooting your installation

The installation of Sitecore Experience Commerce is a fairly easy process, but if you are new to it, you may end up with few installation issues. This blog aims to provide some workarounds and fixes if you encounter these errors.

This post assumes that you are installing Sitecore Experience Commerce 9 initial release on Sitecore 9 update 1

Error: The service cannot accept control messages at this time.

If you see this error message, you can either wait few minutes or do and ‘iisreset’  and start the installation process again. This error message happens temporarily from time to time if IIS is busy in starting or stopping operations.

Error: Get Token From Sitecore.IdentityServer – The remote server returned an error 500

If during the installation process you get the ‘Get Token From Sitecore.IdentityServer’ failed 500 error like below, then this error means that Server Identity has not been able to contact the SQL server and is throwing a 500 error exception. The most probable reason is that you will have multiple SQL server instances running on your machine and the correct value for the “Server:MACHINE-NAME\SQLEXPRESS” has not been passed through the scripts.

Install-SitecoreConfiguration : The remote server returned an error: (500) Internal Server Error.
At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Install-SitecoreConfiguration.ps1:253 char:21
+                     & $entry.Task.Command @paramSet | Out-Default
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
   + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

 

There are 2 options to fix this:

Option 1 (During installation process)

To fix it if you have already started the installation process, open the following configuration JSON files and update the connection string SQL Server instance name manually to Server:”MACHINE\\SQLEXPRESS2016″, in some files you have to do it at 2 places:

1-\SitecoreIdentityServer\wwwroot\appsettings.json
2-\CommerceShops_Sc9\wwwroot\bootstrap\Global.json
3-\CommerceOps_Sc9\wwwroot\bootstrap\Global.json
4-\CommerceMinions_Sc9\wwwroot\bootstrap\Global.json
5-\CommerceAuthoring_Sc9\wwwroot\bootstrap\Global.json
6-\CommerceShops_Sc9\wwwroot\data\Environments\Plugin.SQL.PolicySet-1.0.0.json
7-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.Habitat.CommerceAuthoring-1.0.0.json
8-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.AdventureWorks.CommerceAuthoring-1.0.0.json

Once you have made these changes, please do an iisreset before running the script again from PowerShell.

If you have already come to this step you may want to update the

SIF.Sitecore.Commerce.1.0.1748\Configuration\Commerce\Master_SingleServer.json

file by removing the Tasks that have already been installed. For example you may want to remove the tasks till ImportRootCertificate and run the script again to just initialize commerce and bootstrap your environment.

Option 2 (Before starting the installation process)

If you are planning to install XC9 with multiple instances of SQL servers running locally on your machine, then you may want to do this prior to the installation: (assuming the SQL server you are referring to can be accessed at “MACHINE\\SQLEXPRESS2016” or something similar

1- Unzip the Sitecore.Commerce.Engine.2.0.1922.zip file

2-Navigate to \Sitecore.Commerce.Engine.2.0.1922\wwwroot\bootstrap\Global.json

3-Update the Server value on line 48 and line 97 to match your SQL server instance name

4-Zip the folder again in a way that it doesn’t create any sub-folder and path \Sitecore.Commerce.Engine.2.0.1922.zip\wwwroot\bootstrap\Global.json exists, otherwise you will get an error again.

5-Place it back in the deploy folder

6-Unzip the Sitecore.IdentityServer.1.0.65.zip file

7-Navigate to Sitecore.IdentityServer.1.0.65\wwwroot\appsettings.json file

8-Update the value of SQL Server to match your SQL server instance name

9-Zip the folder contents again ensuring that it doesn’t create any sub-folders and path to Sitecore.IdentityServer.1.0.65.zip\wwwroot\appsettings.json exists

10-Place it back in the deploy folder

Run the script again and it should run without any issues. It will take approximately 50 minutes to do the installation.

This is a known deployment bug and it has been raised this with Sitecore with reference number 36299. This has also been raised on community forum 

Update March 2018: The above error is now fixed in Sitecore Commerce 9 – update 1

Error:HTTP Error 500.19

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

If you get this error, it meas that ASP.NET Core module is not installed correctly on you machine. You can download from here and read more about it from here

Error:HTTP Error 502.5

PS>TerminatingError(Invoke-RestMethod): " IIS 502.5 Error HTTP Error 502.5 - Process Failure Common causes of this issue: The application process failed to start The application process started but then stopped The application process started but failed to listen on the configured port Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspect For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681 "
>> TerminatingError(Invoke-RestMethod): " IIS 502.5 Error HTTP Error 502.5 - Process Failure Common causes of this issue: The application process failed to start The application process started but then stopped The application process started but failed to listen on the configured port Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspect For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681 "
Install-SitecoreConfiguration : IIS 502.5 Error HTTP Error 
502.5 - Process Failure Common causes of this issue: The application process 
failed to start The application process started but then stopped The application process 
started but failed to listen on the configured port Troubleshooting steps: 
 Check the system event log for error messages Enable logging the application process' stdout 
messages Attach a debugger to the application process and inspect For more information 
visit: https://go.microsoft.com/fwlink/?LinkID=808681 
At C:\Program 
Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.0.2\Public\Install-SitecoreConfiguration.ps1:253 char:21
+ & $entry.Task.Command @paramSet | Out-Default
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
 + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
Install-SitecoreConfiguration : IIS 502.5 Error HTTP Error 502.5 - Process Failure Common causes of this issue: The application process
failed to start The application process started but then stopped The application process started but failed to listen on the configured port Troubleshooting steps:
 Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspect For more information
visit: https://go.microsoft.com/fwlink/?LinkID=808681
At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.0.2\Public\Install-SitecoreConfiguration.ps1:253 char:21
+ & $entry.Task.Command @paramSet | Out-Default
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
 + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration


This error is also related to incorrect SQL server values (as mentioned above) double check them in the configuration json files and do an iisreset:

1-\SitecoreIdentityServer\wwwroot\appsettings.json
2-\CommerceShops_Sc9\wwwroot\bootstrap\Global.json
3-\CommerceOps_Sc9\wwwroot\bootstrap\Global.json
4-\CommerceMinions_Sc9\wwwroot\bootstrap\Global.json
5-\CommerceAuthoring_Sc9\wwwroot\bootstrap\Global.json
6-\CommerceShops_Sc9\wwwroot\data\Environments\Plugin.SQL.PolicySet-1.0.0.json
7-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.Habitat.CommerceAuthoring-1.0.0.json
8-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.AdventureWorks.CommerceAuthoring-1.0.0.json

Error: InitiazlieHabitatCommerceServices 502.3 – Bad Gateway error

Initializing Shops: https://localhost:5005/commerceops/InitializeEnvironment(environment='HabitatShops')
PS>TerminatingError(Invoke-RestMethod): " 

IIS 10.0 Detailed Error - 502.3 - Bad Gateway 
  HTTP Error 502.3 - Bad Gateway 
  The specified CGI application encountered an error and the server terminated the process. 
 Most likely causes: 
   	The CGI application did not return a valid set of HTTP errors. 	A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.  
 Things you can try: 
   	Use DebugDiag to troubleshoot the CGI application. 	Determine if a proxy or gateway is responsible for this error.  
 Detailed Error Information: 
    Module   AspNetCoreModule 
    Notification   ExecuteRequestHandler 
    Handler   aspNetCore 
    Error Code   0x80072ee2 
     
  

This error is also related to incorrect SQL server values (as mentioned above) in the configuration json files:

1-\SitecoreIdentityServer\wwwroot\appsettings.json
2-\CommerceShops_Sc9\wwwroot\bootstrap\Global.json
3-\CommerceOps_Sc9\wwwroot\bootstrap\Global.json
4-\CommerceMinions_Sc9\wwwroot\bootstrap\Global.json
5-\CommerceAuthoring_Sc9\wwwroot\bootstrap\Global.json
6-\CommerceShops_Sc9\wwwroot\data\Environments\Plugin.SQL.PolicySet-1.0.0.json
7-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.Habitat.CommerceAuthoring-1.0.0.json
8-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.AdventureWorks.CommerceAuthoring-1.0.0.json

Error: Message=Arithmetic operation resulted in an overflow

ERROR SQL:block:findentity.Error: Message=Arithmetic operation resulted in an overflow..|Trace= v System.Data.ProviderBase.TimeoutTimer.StartMillisecondsTimeout(Int64 milliseconds)
v System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
v System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
v System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
v System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
v System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
v System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
v System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
v System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
v System.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()

This error is also related to incorrect SQL server values in the configuration json files:

1-\SitecoreIdentityServer\wwwroot\appsettings.json
2-\CommerceShops_Sc9\wwwroot\bootstrap\Global.json
3-\CommerceOps_Sc9\wwwroot\bootstrap\Global.json
4-\CommerceMinions_Sc9\wwwroot\bootstrap\Global.json
5-\CommerceAuthoring_Sc9\wwwroot\bootstrap\Global.json
6-\CommerceShops_Sc9\wwwroot\data\Environments\Plugin.SQL.PolicySet-1.0.0.json
7-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.Habitat.CommerceAuthoring-1.0.0.json
8-\CommerceShops_Sc9\wwwroot\data\Environments\PlugIn.AdventureWorks.CommerceAuthoring-1.0.0.json

 Error: sxa.storefront.com is visible in experience editor but not as the published site

If you have used a different HostName value in your installation script then ‘sxa.storefront.com‘ like ‘sitecore901.commerce‘ and wondering why this is not coming up after you have published the webiste multiple times then you need to do the following:

1-Open content editor

2-Navigate to ‘/sitecore/content/Sitecore/Storefront/Settings/Site Grouping/Storefront‘ item

3-Update the value for Host Name field to your host header and publish again

I hope this post will be helpful to you guys while you are installing Sitecore Experience Commerce, any comments/feedback is welcome.

 

Thanks

Naveed

Reference:

https://www.linkedin.com/pulse/installing-sitecore-xc-90-kautilya-prasad

Sitecore Experience Commerce – XC9 – The Uninstall Script

Sitecore Experience Commerce is the new offering from Sitecore in the commerce arena and it is getting lot of attraction. This blog presents a PowerShell script to help out developers during the uninstall process.

I have posted a reference installation script that I have used during installation, (originally taken from the documentation and then added actual version for the packages) so you can always refer to it and compare it with your own script.

It may happen that during your installation, you have entered an incorrect value for a parameter or path to one of the packages. Then you may want to uninstall the the module before you can re-install it again.  Or may be you just want to uninstall the XC9 module to start from scratch. The process of uninstalling XC9 module can be difficult to do manually, so I present a a simple PowerShell script to automate it!

All you need to do is update the Param values (between line 3 and 15) to suit your installation variables and then run from the PS console:

Copy it locally in the deploy folder and run it like .\uninstall-commerce.ps1

All the script is doing is un-installing the SolrIndexes, IIS websites, website physical files and databases.

If you want to completely uninstall Sitecore 9 update 1 version, then use this script

Enjoy!

Naveed

Sitecore Experience Commerce – XC9 – Getting started with Postman

When you will start working with Sitecore Experience Commerce, one of the most important tool that you will need is Postman to run your API calls for various purposes.

This blog is a walk through about how to set it up and get started with it. The example is based upon Sitecore XC9 initial release. It assumes that you have downloaded and installed Postman on your local environment.

1-Disable SSL verification

The first think that you want to do is disable SSL verification from the File > Settings > SSL certification verification. This settings needs to be turned off.

2-Disable AntiForgery Settings

This settings should always be enabled during the production environment, but for requesting API through Postman tool this setting needs to be disabled.

Navigate to \CommerceAuthoring_Sc9\wwwroot\config.json and set the value for AntiForgeryEnabled to false.

3-Import Postman sample scripts

There are various API scripts that are available within the  \Sitecore.Commerce.Engine.SDK.2.0.1922\postman deploy folder location. All you have to do is import them before so you start playing around with the API calls

1-Click on the top import button

2-Select Import Folder and navigate to Sitecore.Commerce.Engine.SDK.2.0.1922\postman location and start uploading scripts.

After the import of the DevOps folder new set of calls will appear in the left hand panel

3-Import the other folder and the individual files too and you will end up with lots of collection as below:

4-Bootstrap Sitecore Commerce

To bootstrap you first need to get the authentication token

If everything is correct, it will generate a token which can be used in subsequent calls

Then scroll down in the left hand panel and under SitecoreCommerce_DevOps > 1 Environment Bootstrap click on Bootstrap Sitecore Commerce

If everything is correct, the Postman will show a success message like this:

Error: The required antiforgery header value “X-XSRF-TOKEN” is not present.

If you are trying to bootstrap and you get this as 500 error

Check the logs at \CommerceAuthoring_Sc9\wwwroot\logs

If the error message is related to antiforgery as below, then you need navigate to \CommerceAuthoring_Sc9\wwwroot\config.json and set the AntiForgeryEnabled  value to false. Also do an iisreset or recycle the app pool

ERROR Connection id ""0HLBOLTT3AJ84"", Request id ""0HLBOLTT3AJ84:00000001"": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery header value "X-XSRF-TOKEN" is not present.
   at Microsoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgery.d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.Commerce.Core.CommerceController.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionFilter.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.Commerce.Core.ClientCertificateValidationMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.Framework.Diagnostics.DiagnosticMetadataMiddleware.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.Framework.Diagnostics.DiagnosticPageMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.d__2.MoveNext()


That’s all there is, checkout the other sample API calls and get familiar with them!

Happy Sitecoring!

Naveed

Sitecore Experience Commerce – XC9 – First Look and Feel

Sitecore released their much awaited module – Sitecore Experience Commerce (or XC9 in short) in late January 2018. As an avid Sitecore enthusiast, I was eager to learn more about it. On a free weekend, I decided to install and play with it. This blog is about the first look and feel about the XC9 module and only explores very high level features. The detailed documentation about the module can be found at the official site.

The Storefront

Once the installation is complete, the modules comes with an sample store called the Storefront.

The home page comes with featured carousel and product list components (SXA based)

Clicking on any of the top menu items (for example Appliances) will present the list of products with filtering and sorting options:

Clicking on an individual item will take the user through to the product details page, where the user can add the product in their shopping cart:

The Checkout Process

The checkout process is very user friendly and can be compared with any top of the line commerce stores. For example if the user decides to add a laptop and click on the ‘View Cart‘ link from the top right, the user will be shown the summary of cart:

The user can either click ‘checkout‘ or click ‘continue shopping great products‘. If the user decides to click the ‘checkout‘ button, the next screen asks for delivery details to calculate additional shipping charges:

The user can check ‘Ground’ option and click ‘Continue to billing’. The next screen asks for ‘Billing’ details and also includes shipping charges:

Before the user can continue,  the user must validate credit card details. At the moment, the system is configured to use Braintree sandbox account. The user can enter any of the test credit card details available from the Braintree website and click ‘Validate Payment’:

Once the credit card has been validated, the user can proceed to the final review screen before hitting ‘Confirm Order‘ button:

The final screen will show order confirmation number:

That was an amazing experience for buying a product and as a user, I am very much impressed!

The Business Tools

So that was the customer experience, now lets see what is there in the for the back office administrators. After installing the XC9 module a new icon as ‘Business Tools’ should be available for admin users from the Sitecore Experience Platform dashboard.

The Business Tool dashboard comes with 7 sub-modules to manage the store.

  • Merchandising
  • Inventory
  • Pricing
  • Promotions
  • Orders
  • Customers
  • Relationship Definitions

Since the user has just made a purchased, lets checkout what is in the ‘Order’ module

Clicking on the ‘Order’ link from the dashboard or side link, the admin user can see one order is in the ‘Pending’ state:

Clicking on the pending order link, the admin user can see the details about the order:

This out of the box back office processing system for admin users looks amazing as they can instantly see all the order summaries and details. I will pause the exploring rest of the commerce modules as they require much more detail and perhaps another blog.

The Storefront Content Tree

The Storefront content tree is based upon conventions and structure introduced by SXA module. The SXA modules comes with 80+ components for speeding up the development process.

A new set of commerce components are added in the SXA toolbox library.

All of the pages in the Storefront are developed using SXA or Commerce-SXA components.

Summary

As you can see, Sitecore Experience Commerce 9 is a very rich and extensive module for developing an online store. In this blog, I have only scratched the surface of the module and I am super excited about it. The 40+ commerce SXA components, the 7 back office processing modules, and additional 80+ standard SXA components for rapid website development, all together deliver a knockout punch in the online commerce industry

In my opinion, Sitecore XC9 module will definitely meet the expectations of any business looking for a modern, cloud-ready and secure online store. So, if you manage an online store and looking for replacement options, do evaluate  Sitecore Experience Commerce out before making any decisions.

Thanks

Naveed

SXA Rendering Variants – The Hidden Gem of Sitecore Experience Accelerator (SXA)

Sitecore Experience Accelerator  (SXA) is a great productivity tool as it reduces your development time by giving you pre-built components. There were few new concepts and features that were also introduced with SXA like Page design and Partial design, pluggable themes, grid and column layout etc, but as the topic suggest, I will be focusing upon “Rendering Variant” concept and will try to explain how can this change the way you architect your website (assuming that is based on SXA).

Problem Statement

Let’s begin with a problem statement, the UX team have prepared a landing page and they have the various content components on the page displaying Image, Rich Text and Link all in a box but in various styles as below:

  1. Half-width component with Image and Text
  2. Half-width component with Image, Text and Link
  3. Full-width component with Image on Left, Text and Link on Right
  4. Full-width component with Image on Right, Text and Link on Left

They also want the content authors to have the ability to add them, remove them and order them in any way they like.

Sounds familiar ?

If I am not using SXA module, one of the approach would be to make these different components available via Experience Editor which content editor can add/remove/order from the content page. This means that there will be different “View Renderings” for each of the components types. Different view rendering mean different Data Source Templates and Data Folder Templates. So for the simple content based components above, we end up having 4 different view renderings, which more or less have same content but it is displayed differently.

SXA Approach

 

There is nothing wrong with the above approach, but if you website is based on SXA module you would have another tool to  meet your goal in a more effective manner.

The SXA provides a feature called Rendering Variant which optimizes the process of showing different variations of the same component. The variations can be setup via content editor and can also be supplemented with predefined styles and scripts.

The best way to explain Rendering Variants is by an example. I will be using the out of the box “Promo” component that comes with SXA. I am only interested in 3 data fields PromoText, PromoIcon and PromoLink (there are other properties too, but let’s keep it simple)

Promo Data Template

Rendering Variants are located under the /Site/Presentation/Rendering Variants node. In my case, the location was:

/sitecore/content/Tenant Folder/Tenant 1/Site 1/Presentation/Rendering Variants/Promo

Out of the box there was one rendering variant already present as ‘Default’.

Default rendering variant

I made a copy of that component and called it ‘Promo with Image and Text’

Promo with Image and Text rendering variant definition

I then deleted last child item ‘Promo Link’ from the recently created rendering variant and clicked save. The ‘Default’ rendering variant was renamed to  ‘Promo with Image Text and Link’ for readability purposes. And just by doing these few content item operations, I was able to achieve my 2 component variations (under like 1 minute, thanks to SXA)

To verify my changes I tested them out in experience editor. First I added a column splitter component to divide the page into 2 equal halves, then I  uploaded some stock images, added the Promo component from the Toolbox in each of the half , added random text and selected my variants via the dropdown. They worked like a charm!

Promo with Image and Text, Promo with Image, Text and Link

Similarly, I created a copy of the existing variants and called it “Promo with Image left” . I then added a ‘Section’ item for the variant definition and called it ‘Container’. I then moved “Promo Icon” under it. I also added the bootstrap class of ‘col-xs-6’ to ‘Container’ item and to the ‘Promo Text’ item.

Section item surrounding PromoIcon field in rendering variant definition

As you can see in the screen shot above, there are other types of variant definition items as well, check them out from the official site and see how flexible they are to give you almost any kind of rendering variation that you like.

For “Promo with Image Right” I created a copy of the “Promo with Image Left” and just reversed the order ‘Promo Text’ and ‘Container’ sections:

Image Left and Image Right rendering variant definitions

To verify my changes, I navigated to the Experience Editor, dropped the ‘Promo’ component on the page and changed its rendering variant via the dropdown to get the results below:

Promo component with Image Left
Promo component with Image Right

And that’s it, without even writing a single line of code, I was able to get all 4 component variations. In theory the number of variations that could be achieved using rendering variants are unlimited and totally depend upon your UX and Design.

Conclusion

If you are starting a new website based upon SXA module, you must consider rendering variants for your components as it will change the way you architect the website. This was a simple post but it showed the true power of SXA and how Rendering Variants can reduce back-end development efforts and also improve the content authoring experience. Kudos to SXA development team for this awesome feature!

Have fun

Note: If you want to play around with the, here is the link to the rendering variant package. I have used Sitecore 8.2 update 5 and SXA 1.5.