Improving Email Notifications for E-Commerce in Kentico 13

Temp mail SuperHeros
Improving Email Notifications for E-Commerce in Kentico 13
Improving Email Notifications for E-Commerce in Kentico 13

Optimizing Customer Communication

Ensuring clients are informed about their orders is essential for preserving customer happiness and confidence while managing an e-commerce platform. Strong capabilities are available in Kentico 13 to automate these kinds of communications, especially when it comes to order status updates. The customer experience can be substantially improved by having the option to send personalized emails when an order status changes to "shipped."

Nevertheless, developers may run into issues when dynamic material is treated as static text due to template variables not being appropriately detected. This problem may make automated emails less effective because important data, such as tracking numbers, may not show up correctly. It takes a deeper comprehension of Kentico's templating functionality and probably some troubleshooting with the liquid template syntax to handle these peculiarities.

Command Description
EmailTemplateProvider.GetEmailTemplate Identifies and retrieves an email template from Kentico's email template collection by name and website.
EmailMessage Creates a new instance of an email message that may be filled with information such as the sender, recipient, topic, and body.
MacroResolver.Resolve Processes a text string, substituting assessed results for macro expressions according to the circumstances at hand.
EmailSender.SendEmailWithTemplateText Sends an email using the text from the template that has been provided, enabling macro resolution in the email body.
EventLogProvider.LogInformation Records informative messages in the event log of Kentico; this is helpful for monitoring actions such as sending emails.
{% capture %} Initiates the process of capturing the output to a string variable in Liquid templating, a popular tool for creating dynamic email content.

Detailed Description of Kentico CMS's Automated Email Scripts

The script in the backend solution for Kentico 13 manages and sends emails automatically when an order status changes to "Shipped." It does this by utilizing a number of specialized commands and classes that are made available by Kentico's API. Maintaining uniformity and branding in communications is crucial, and the essential component 'EmailTemplateProvider.GetEmailTemplate' retrieves the predefined email template. Next, a 'EmailMessage' object is created using this template, acting as a container for the email's body, topic, sender, and recipient.

Additionally, the script uses 'MacroResolver.Resolve' to add dynamic content to the email body, like the tracking number for the order. This is essential for sending clients personalized emails and pertinent information. 'EmailSender.SendEmailWithTemplateText' is called to send the email after it has been constructed and personalized, taking care of any macro resolves within the template as they happen. Enhancing system stability and traceability, logging the activity with 'EventLogProvider.LogInformation' guarantees that all send activities are documented for audit and debugging reasons.

Putting Automatic Email Notifications Into Practice in Kentico 13

CMS for Kentico 13 with a C# backend solution

using CMS.EmailEngine;
using CMS.EventLog;
using CMS.DataEngine;
using CMS.SiteProvider;
using CMS.Helpers;
public void SendShipmentEmail(int orderId)
{
    OrderInfo order = OrderInfoProvider.GetOrderInfo(orderId);
    if (order != null && order.OrderStatus.StatusName == "Shipped")
    {
        EmailTemplateInfo emailTemplate = EmailTemplateProvider.GetEmailTemplate("OrderShippedEmail", SiteContext.CurrentSiteName);
        if (emailTemplate != null)
        {
            EmailMessage message = new EmailMessage();
            message.EmailFormat = EmailFormatEnum.Default;
            message.Recipients = order.OrderCustomerEmail;
            message.From = EmailHelper.GetSender(emailTemplate, EmailHelper.GetDefaultSender(SiteContext.CurrentSiteName));
            message.Subject = EmailHelper.GetSubject(emailTemplate, "Your order has been shipped");
            message.Body = MacroResolver.Resolve(
                emailTemplate.TemplateText.Replace("{{trackingNumber}}", order.GetStringValue("OrderTrackingNumber", string.Empty)));
            EmailSender.SendEmailWithTemplateText(SiteContext.CurrentSiteName, message, emailTemplate, null, true);
            EventLogProvider.LogInformation("SendShipmentEmail", "EMAILSENT", "Email sent successfully to " + order.OrderCustomerEmail);
        }
    }
}

Handling Dynamic Email Content with Macros in Kentico

Kentico CMS macro utilization

{% if (Order.OrderStatus.StatusName == "Shipped") %}
{% capture emailContent %}
Order Update
Your Order
Your shipment is on its way!
Here's your tracking number: {{ Order.CustomData.m_c_orderShippingForm_OrderTrackingNumber_txtText }}
{% endcapture %}
{% EmailSender.SendEmail("no-reply@yourdomain.com", Order.OrderCustomerEmail, "Your Order Has Shipped", emailContent) %}
{% endif %}

Increasing Consumer Involvement with Kentico's Dynamic Email Automation

Dynamic email automation in Kentico makes it possible to send content-specific emails in response to user activities or data changes, like updates on the status of an order, hence facilitating more tailored customer interactions. In order to guarantee that customers receive timely information regarding their purchases, this automation directly interacts with the e-commerce module using Kentico's sophisticated CMS capabilities. Using dynamic content has the benefit of making messages more relevant, which raises consumer satisfaction and loyalty.

Additionally, communication workflows can be greatly streamlined by combining dynamic email content with e-commerce activities. Because the system notifies users automatically and without human input, it streamlines procedures and lowers the possibility of human error. Businesses may customize every message to fit unique situations by utilizing Kentico's templating features. This can boost engagement rates and improve customer service encounters all around.

Important FAQs about Kentico's Email Automation

  1. In Kentico, how do I configure email automation?
  2. The Marketing Automation module in Kentico allows you to build up email automation by creating processes that send emails in response to particular actions or criteria.
  3. Is it possible to send emails using external services and Kentico?
  4. Yes, Kentico's Email Relay settings allow for connectivity with third-party email providers like SendGrid or Mailgun.
  5. Is it feasible to modify Kentico email templates?
  6. Yes, Kentico has an adaptable email template editor that lets you modify HTML directly or with a WYSIWYG editor to customize layouts, styles, and text.
  7. How is email tracking handled by Kentico?
  8. By inserting a tiny picture pixel into every email sent, Kentico records emails and lets you see open rates and link clicks in the Email Marketing module.
  9. Is it possible to plan an email to be delivered later in Kentico?
  10. Indeed, emails can be set up to be delivered at a later time using marketing automation tools or directly within the email widget.

Concluding Remarks on Kentico's Automation of Communications

Using Kentico 13's robust templating and macro features correctly is essential to the implementation of automated communications. This guarantees that emails are sent out when order statuses alter and that the information within, including tracking numbers, is correct and pertinent. Understanding Kentico's API and liquid templating syntax in detail is necessary to solve problems involving dynamic content recognition. Once understood, these skills greatly improve the post-purchase experience for customers by offering timely updates and information.