Introduction
As a marketer, you can automate the process of notifying users about weather updates. This helps you eliminate the need to manually send campaigns each time the weather changes. 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 an email notification about the current weather in their city and get some offers on products relevant to that weather condition.
library_add_check |
Prerequisites
|
Create a Business Event
In this section, let's create a business event for your account using the MoEngage Business Event public API to capture all the required details. After setting up the event, we 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 it to MoEngage through Postman or any other tool you choose. 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 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:
- Go to the MoEngage Dashboard and create any Business Event Triggered campaign.
- In 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's 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 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 will 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 for your Email campaign.
Step 2: Content
- Select the template that you would like to use. 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 must 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.
- Select the information from the business event or the user attributes.
- Click Done.
- Click Next to move to the third step, "Schedule and goals," where you can define your campaign's schedule and goals.
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. Based on your business requirements, you can decide when to pass this event to MoEngage.
Here is a payload example:
{
"event_name": "WeatherUpdate1",
"event_attributes": {
"City": ["Bengaluru", "NewDelhi", "Kolkata"],
"Current Weather": "Rainy",
"Suggested tool": "Raincoat"
},
"triggered_by": "john.joe@example.com"
}
Conclusion
In this use case, we created weather updates through email notifications. We used Business Events in MoEngage to achieve this. The logic for triggering this event lies on your 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.