0 Comments

Having not found time to write this entry until now James Hirka, who encouraged me to post this, probably will call me “Slacker” =P.  But ultimately I’m writing this to share my Troubleshooting experience with you.

Issue

Received an error message as shown below on UAT environment, but this solution totally working on Dev (local) Environment.

image

Troubleshooting Steps

The first reaction of seeing this error, I thought it’s because of the UAT server block the communication between SMTP provider and the server. So I tested with PowerShell script.

 

The PowerShell script worked.

I thought it could be caused by authentication,  so I tested with PowerShell with wrong password. Bingo! I got the same error message.   Then I checked the Sitecore configuration, however, it looks right to me.

<setting name="MailServer" value="xxxxxxx” />
<setting name="MailServerUserName" value="xxxxxxx"/>
<setting name="MailServerPassword" value="xxxxxxx" />
<setting name="MailServerPort" value="xxx" />

I also double checked the action parameters. same credentials.

What?! This is wired. what could be the issue!!

image

So I then start to output the SMTP settings credentials by overwriting the send email action.  The output looks correct. Why!!!,  What’s going on!!

Then I created a console application, just for testing and it worked fine..

 

Ultimate solution

Thanks to James Hirka, who introduced me a great tool Wireshark.  With Wireshark you can listen on a port and monitor all the requests from the sever.

image

Ultimately, we FOUND the issue: the password is wrong, This was caused by invalided xml format of the action parameter.

Here is the invalided action parameter

<Password>xxxx<Password>

Note this missing back slashin the above parameter, seriously?! .  There is still question about why the output is correct (Didn’t fail in the action, but in the pipeline.) This is not in the scope be in this post, but I will dig into the pipeline and post the result shortly.

Other suggestion to WFFM could be to put at least xml formatting validation for such field, it would be nice to validate the format early and may save a lot of time in future. 

0 Comments

I have to admit that the most painful process for setting up Sitecore solution is to configure CD/CM on each of the environments, and most worse case is you will have to do it again and again.  It’s not only time consumed, but also causing unexpected errors if you accidently disabled configuration which shouldn’t have been disabled. Then you will be like this

image

It could take up to an hour to configure each of the server. Imagine you have UAT (CDx2 and CM), PROD (CDx2 and CM), then you will probably spend half day just configuring these files.

Therefore, I decided to create a PowerShell script to automate the whole process.  Here is the example, but you can find the entire script on Github.

The current script is for Sitecore 8.2.2 based on Sitecore official documentation, I will continuously update the script to support more version of Sitecore.  If you think it’s a good idea and also would like to contribute for specific version,  please feel free to make a pull request.

The “SCRIPT SETTINGS” is global settings, you can integrate with Octopus variables for automatically configure different environments.

0 Comments

In my previous post – Leverage Sitecore xDB fro newsletter subscription I wrote last year, I talked about how to use EXM segment list to create newsletter subscription function.  If you haven’t read yet,  I recommend to read it first before starting to read this article.  In this article, I’m going to explain how to update user subscriptions by creating a form with WFFM and sending an EXM confirmation email with WFFM.

 

Recap the requirement

I’m going to start with a recap of the requirement.  Basically, client wants to manage their newsletter  subscriptions within Sitecore, and allows users to update their newsletter subscriptions on the website.

image

 

What has been architected

I created a form with WFFM for updating user newsletter subscriptions, and content editor is allowed to update the opt ins  i.e. Kids in the park (shown in screenshot above) as well as to map the opt ins with the custom newsletter subscription facets so as to automatically segmented user into corresponding email group. How to segment users  in EXM is not part of the scope of this post, but you can always refer back to my previous post.

 

Also, I created a custom action for sending the confirmation email which is defined within EXM, as well as a custom save action for updating contact subscriptions facets.

Here is the overview workflow diagram

image

 

Three Main Challenges

  • Initial form value based on contact subscription profiles on form loading.
  • Allow content editor to map option in with subscription facets in xDB.
  • Send confirmation email that defined in EXM.

image

Solutions for achieving each of the above listed challenges

  • Initial form value based on contact subscription profiles on form loading.

By default, WFFM allows you to initial the field value by passing value in query string. But we think it’s not best solution for rendering value with query string as :

  1. Potential safety issue
  2. Limitations in the length of query string
  3. Limitations in the filed type of WFFM

Therefore, we come up with the solution by creating custom field rules. How to create custom rule is not in scope, but you can find information on Sitecore documentation portal and it was also explained by Jeff Darchuk in here.

image
  • Allow content editor to map option in with subscription facets in xDB.

For mapping the optins, we create custom checklist field and utilizing the values as text feature for mapping the contact facets with each of the options in the checkbox list.

image

  • Send confirmation email that defined in EXM

A custom action has been created and here is the sample code for sending the EXM messages programmatically.

image

0 Comments
Today, I spent a few hours on researching about how to implement custom index field with Examine in Umbraco7. There are plenty of resources talking about IndexUserField, IndexAttributeField but none of them is actually using custom field.

So I looked into the Umbraco API, and worked it out. If you knew Examine, you can ignore this part, and jump to the solution straightaway. Otherwise, I want to give you a little intro to what is Examine.

What is Examine?

Examine wraps the Lucene.Net API, which makes it easy for Umbraco developers to build index and search data [1]. Lucene open source search engine enable us to build a search driven and a high performance website.

What is custom index field?

Custom index field, also called "computed filed", is normally not existing in your database, but frequently used in program.

How to implement?


There might be other ways to implement "custom index field", but here I am going to introduce "UmbracoContentIndexer". UmbracoContentIndexer is an indexer for creating index document by getting data from Umbraco nodes. All you need to do is to add "custom index field" by overriding "GetDataToIndex" method.

Reference
[1] http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine

0 Comments
Google Chrome removed showModalDialog API since version 37 or later

What does it mean?


The publish function of Sitecore which version is prior to 7.1 is no longer working. This is because that Google Chrome removed showModalDialog API from its version 37 or later. For information can be found here.

What's the Solutions?


Reference

[1] https://kb.sitecore.net/articles/581527
[2] http://blog.chromium.org/2014/07/disabling-showmodaldialog.html