0 Comments

I would like to share the experience of joining Sitecore Hackthon 2017 competition.  It’s a global  24 hours competition organized by Askshay Sura and supported by Sitecore.  This year there are 92 teams from 26 countries being represented.  

Azadeh, Budi and I,  as a team,  attended the competition last weekend and we created a Sitecore ChatBot. If you like us, please give me a thumb

https://www.facebook.com/walle.yuan/posts/10213259608590954?pnref=story

clip_image001

A chatbot is a service, powered by rules and sometimes artificial intelligence, that you interact with via a chat interface. The service could be any number of things, ranging from functional to fun, and it could live in any major chat product (Facebook Messenger, Slack, Telegram, Text Messages, etc.)

clip_image002

  • What it can do for business?

clip_image003clip_image004clip_image005

  • So, What Sitecore ChatBot does?

We utilized the Azure Chatbot service and integrated with Sitecore, so as to make the response more focused and relevant to the business. Business can launch the business to different communication channels in a sec. 

clip_image006

  • Videos we created about the technologies we were using

Part1: https://www.youtube.com/watch?v=mPR0pk-usBY …
Part2: https://youtu.be/UJrzGhjfpTo

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

Heard Sitecore Connector long time back, but never really got a chance to use it for any client solutions until now.  The settings are quite straightforward, and the main purpose for this article is to demo how to setup Facebook account with the Social Connector Module.

 

Steps for settings social accounts

  • Going to System-> Social (shown as below)

image

Firstly, I created Applications for staging production separately, so that I can switch to the correct application easily after deploying to the target environment.  There are three fields on the Application template

  • Application ID
  • Application Secret
  • Public API Key (ONLY for Google+)

Next, I created account which will be used when post a message.  To create a specific account i.e. Facebook Account, you will have to select the corresponding Application that you just created in the previous step.  and select a page you wish to post to.

image

image

Once you’ve done above, select a page in Content tree, and click Message button in Publish Tab.  Create a message and post it.

image

There are more about how to track the campaign performance and how to setup the workflow etc. These will be all addressed in the future blog.

0 Comments

Requirement

Newsletter subscription is a common requirement for most for website. Never really think about this function properly, until now client wants to send a scheduled newsletters to all subscribed users.  It sounds simple, isn’t it?  However, when you started to think about a bit in deep, you will probably start to ask questions like below:

  • Who are these users? 

The user must be contacts.  A contact represents an individual who interacts with or may potentially interact with the website.

  • How do I know whether or not the contact subscribed newsletter?

Then you started to realize you need a attributes on contact profile, which means you will most likely need to create a custom contact facet.

  • How to create a dynamic contact list?

Once a contact subscribed newsletter on the website, the contact need to be automatically added into your newsletter subscription contact list.  The answer is simply to use segment list.  Then you realized “damn, I need to create a custom rule”  for segmenting contacts based on the custom facets.

 

Solution

To interoperate the requirements into technical requirements, I drew a  kind data flow diagram, and highlighted custom functions we need to achieve the above requirement.

  1. custom contact facet
  2. programmatically update contact in xDB
  3. Add custom contact facet into contact index.
  4. custom rule condition

 

 

image

 

Implementation

In this section, I will demo the implementation. The demo code is supported Sitecore 8.1 (upgrade-3 or above).

custom contact facet

Sitecore well documented how to create a custom contact facet.   Based on the document I created SubscriptionInfo facet.

Here is the example:

  • Create an Interface

image

  • Create a Facet class

image

  • Register in Analytic Model

image

 

programmatically update contact

Once you’ve create custom facet, next step is to update contact.

Here is the example:

image

Submitting a newsletter subscription, then you can verify the data in xDB

image

 

Add custom contact facet into contact index

In order to use the segment condition, you will need to add the custom facet into index.  Luckily, Sitecore provide a good guide about how to index these custom contact facets during aggregation process.  All you will need to do is to extend the contactindexable.loadfields pipeline.

Here is the example:

image

custom rule condition

Last thing left is to create a custom segment condition, which allows you to check whether or not the contact subscribe the newsletter.

image

 

Once you completed all above, you can now go to List manager and create your segment

image

 

Contacts will be dynamically added into your contact list, which allows newsletters to be sent to the segmented contacts easily.

image\

image

Conclusion

It’s not complicate right?  Hopefully, you will enjoy creating your own facets and rock and roll =P.

References

  1. https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/contacts/index_custom_contact_facets
  2. https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/contacts/contacts
  3. https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/the_list_manager/creating_lists/create_a_contact_list_or_a_segmented_list