Introduction
As a marketer, you can automate the process of notifying users about the weather update, eliminating the need to manually send campaigns each time there is a change in the weather. In this article, we will explore how to set up these campaigns once and let MoEngage handle the rest. By leveraging Business Events in MoEngage, you can automate the entire campaign process, ensuring that relevant values are dynamically updated to deliver the right message at the right time to your customers, without any manual intervention.
Expected Result
Users will receive a notification informing them about the current weather in their city and will get some offers on products relevant to that weather condition.
library_add_check |
Prerequisites
|
Create a Business Event
In this section, let us create a Business Event for your account using the MoEngage Business Event public API to capture all the required details. After we set up the event, you can use this event format to notify whenever there are extreme weather conditions in the city. For our example, the Business Event will include the following information:
- Event name: “WeatherUpdate1"
- Attributes of the event and their data type:
- City - string
- Current Weather - string
- Suggested tool - string
Perform the following steps:
- Write the information above in the JSON format and send to MoEngage through Postman or any other tool of your choice. Refer to this Business Events API documentation for more details.
{ "event_name": "WeatherUpdate1", "event_attributes": [ { "attribute_name": "City", "attribute_data_type": "string" }, { "attribute_name": "Current Weather", "attribute_data_type": "string" }, { "attribute_name": "Suggested tool", "attribute_data_type": "string" }
- Make the API call. After the call is made and the event is created successfully, MoEngage will send the following response:
{ "message": "The business event has been created", "_id": "664f9cebd52979785bcadaf4" }
- To verify if the event was successfully added, open the MoEngage Dashboard and navigate to any Business Event Triggered campaign. From the Select Business Event drop-down list, you can check for your event. You should see the "WeatherUpdate1" event listed there.
Create an Email Campaign
In this section, let us create weather-based alerts through business event-triggered email notifications.
Step 1: Target Users
- Navigate to the sidebar on the left and click Engage > Campaigns and click + Create campaign or click + Create new > Campaign.
- Under Outbound, select Email > Business Event Triggered.
You are taken to the first step "Target users" of defining your campaign. -
Enter the following details:
- Team: Select a team if your organization has teams enabled for your account. For example, select "Demo Account - E-commerce". For more information, refer to Teams in MoEngage.
-
Campaign Name: Enter a name for the campaign. For example, "Weather-Based Contextual Comm".
- Campaign Content Type: Select Promotional/Marketing.
- Subscription Categories: Select a category. For example, select "Last_Hour_Discount". This would help you target only those users who have opted-in to receive communication about a specific category.
-
User attribute with email address: Select "Email (Standard)".
- From the Select business event drop-down list, select the "WeatherUpdate1" event.
- In the Target Audience section, select the user attribute “City“ and map it with the Business Event Attribute “City“. So whenever in the business event API, the value in the event attribute matches the same of the user’s city, all those matched users will receive the email communication.
The business event attributes are now available in the drop-down lists. The event attribute "City" can now have a dynamic value each time the business event is triggered, with the value for "City" automatically substituted in the segmentation query. - Click Next to move to the second step "Content" where you can define the content that will go into your Email campaign.
Step 2: Content
- Select the template that you like to go with. For our example, lets use a blank HTML template on the Custom HTML editor tab.
- Add the following details:
- Subject
- Preview Text
- Sender Name
- From email address
- Reply-to email address
- In the Template editor section, enter the content of the email message.
The content for such communications would need to have the values picked from the business event’s attributes, which can be done similarly to any other personalization. - Personalize the message by including information such as the user's name. This makes the message more contextual and helps users feel more connected. To do this, enter “@”. The Push Personalization pop-up will be displayed, allowing you to select information from the business event or the user's properties.
- Click Next to move to the third step "Schedule and goals" where you can define the schedule and goal of your campaign.
Step 3: Schedule and Goals
- Define when to start and end this campaign and the conversion goal based on your requirements.
- Change the deliverability settings based on your requirements. For more information, refer to Create Email Campaigns.
- Click Publish.
Trigger Campaign by Triggering Business Events
We are now ready to start triggering the communications. When there is a weather update for the city, the campaign can be initiated using the Trigger Business Event trigger. The decision of when to pass this event to MoEngage is determined by the client based on their business requirements.
Here is a payload example:
{
"event_name": "WeatherUpdate1",
"event_attributes": {
"City": ["Bengaluru", "NewDelhi", "Kolkata"],
"Current Weather": "Rainy",
"Suggested tool": "Raincoat"
},
"triggered_by": "kuber.yadu@moengage.com"
}
Conclusion
In this use case, we created weather update through email notifications. We used Business Events in MoEngage to achieve this. The logic for triggering this event lies on the client's side. For instance, whenever there is a weather update for the city they can create a business event for it, which will be used to trigger the campaign.