Skip to main content

Introduction

AccuWeather is a media company that provides weather forecasting services worldwide. AccuWeather Enterprise Solutions include the most accurate, site-specific, customized severe weather warnings; short- and long-range forecasts; and applied weather information.

MoEngage and AccuWeather

The MoEngage and AccuWeather integration lets you enrich and personalize your marketing campaigns and automate translations. You can fetch user location and weather updates on the fly and send personalized campaigns in real time. For example, an ecommerce brand can detect a high likelihood of rain at a user’s location and send a message that nudges them to buy an umbrella. MoEngage push notification preview using personalized weather content

Integration

Prerequisites
  • An AccuWeather account.
  • Access to your AccuWeather API keys. Contact your AccuWeather account manager for compatible API keys. For more information, see AccuWeather API.

Available APIs

The following AccuWeather APIs can be used within your MoEngage campaigns:

Steps

The example below shows three message variants based on the current weather conditions at the user’s ZIP code. We use AccuWeather’s Locations and Current Conditions APIs. You make two API calls — the first to get the user’s location and the second to get the current weather conditions at that location.
  1. Go to step 2 of campaign creation.
  2. Call AccuWeather’s Locations API and store the location details in a new variable called location_info. The Key is a useful variable as it is used in the next request. For more information, see the API response reference.
    If you do not capture a zipcode user attribute, you can use the user’s city instead.
  3. Call AccuWeather’s Current Conditions API using the location_info variable and store the result in a new variable called local_weather. For more information, see the API response reference.
  4. Define your campaign content based on the local weather. For example:
    • If local weather is Sunny → “Get a sunscreen”.
    • If local weather is Rain → “Get an umbrella”. MoEngage editor with conditional weather-based content templated using JINJA
  5. Print the output in the template or use Personalized Previews to preview. Personalized preview showing the rendered weather-based message
If the API response returns Rain for {{local_weather[0].WeatherText}}, the user receives the push message “It’s raining. Get an umbrella”.