Sitecore version: 9.0.2

Business scenario: If a customer leaves with items in cart, we have to send a mail with the details of the items in the cart. At max, we have to display only 4 items in the mail.

The HTML structure and the mail:

The HTML layout contains a table with 4 nested tables inside it for each item in the cart (considering the scenario for the maximum items to be displayed).

Way ahead: So, as the requirements are clear let's move to the implementation.

Given the different business dependencies, we are going for an automatic campaign with the inbuilt HTML as the template.

Approach and blockers: We thought that we will use tokens to apply 'display: none' to the tables which we will have to hide. But the approach failed. More detail on it is here.

Post that we tried to apply the suggestions provided in the answer mentioned above. We tried it both ways, in-line as well as through the class. But the success evaded us whenever we checked the mails in our mailbox.

Mail-systems in question: Right now we are focusing on three mails system: 1. Gmail 2. Hotmail 3. Outlook

But yes the business has asked for all.

I believe that what I am trying to achieve is not something uncommon but there is something which we are missing.

Please help me to solve this puzzle.

Thanks in advance.

  • Since you generate this mail yourselves, why bother hiding stuff? Why not just not-render the items you don't need? – Mark Cassidy Aug 13 at 13:29
  • @MarkCassidy: Please elaborate it more or point me to a link. That will be helpful. – NutsAndBolts Aug 13 at 13:40
  • This site is not a support portal. Your question is regarding a very bespoke requirement to your solution and the way you've chosen to implement it. Further - this question is really just a rewording of the question you linked to - on how to hide elements from your mail. – Mark Cassidy Aug 13 at 13:44

Browse other questions tagged or ask your own question.