Introduction
Jasper.ai is an AI writing tool designed to generate marketing copy, such as blog posts, product descriptions, company bios, ad copy, and social media captions.
MoEngage <> Jasper.ai
With the MoEngage and Jasper.ai integration, you can use Jasper.ai's Generative AI to send out hyper-personalized and effective campaigns across channels on MoEngage.
Integration
library_add_check |
Prerequisites
|
Display dynamic content in MoEngage Campaigns
Using MoEngage's Content APIs, you can dynamically add content created by Jasper.ai inside MoEngage campaigns for a more personalized experience. Below is an example of generating a personalized subject line by using Gen AI, for an email campaign:
Step 1: Set up a MoEngage Content API
info |
Information We've revamped our dashboard settings UI. Content API is now available in Settings -> Advanced Settings -> Content API in the revamped UI. For more information, refer to Summary of Changes - Settings UI Revamp. |
-
Navigate to Settings -> Advanced Settings -> Content API. Click + Add content API at the top right corner of the Content API screen.
Navigate to Settings >> APIs >> Content API. Click Add.
- Add your Jasper.ai API to the endpoint URL. Depending on your use case, the endpoint will change.
To display a personalized AI-generated subject line, use Jasper.ai's Run Command API.
While setting up your content API, select and method as POST and insert the following URL:
https://api.jasper.ai/v1/command
Leave the URL Parameters as blank.
Under Headers, add the following:
-
X-API-Key
: For this, you need to generate a new Access Token from Jasper.ai's dashboard. -
content-type
:application/json
-
accept
:application/json
Under Body Type, select Raw, add the following:
{ "inputs": { "command": "Write a personalized email subject line for a campaign about Christmas holidays", "context": "Email is being sent to {{UserAttribute['First Name']}} {{UserAttribute['Last Name']}}", "toneId": "<your_tone_id>" }, "options": { "outputCount": 1, "outputLanguage": "English", "inputLanguage": "English", "languageFormality": "default", "completionType": "performance" } }
-
- Click on "Save" and then "Done" once you see a successful response.
- Note - You can also test your APIs. To test your APIs, from the Content API's action menu, click on "Test". You can your API response and validate it.
Step 2: Display your content inside MoEngage campaigns
To use this API in your MoEngage campaigns,
- On step 2 on your campaign creation, enter @.
- In the pop up, you can select Jasper.ai Content API configured in Step 1.
- You can use MoEngage Templating Language to parse through the API response and use the content in your campaigns.
To display the subject line generated by Jasper, you can use the following code:
{% set response = ContentApi.JasperAiParagraph({({"params":{},"static_params":{},"dynamic_params":{},"request_body":{"inputs":{"command":"Write a personalized email subject line for a campaign about Christmas holidays","context":"Email is being sent to {{UserAttribute['First Name']}} {{UserAttribute['Last Name']}}","toneId":"ton_2ee766eaa4ef48e59da1d9602bfecf2d"},"options":{"outputCount":1,"outputLanguage":"English","inputLanguage":"English","languageFormality":"default","completionType":"performance"}}})}) %}{{ response.data[0].text }}
- You can click on the Preview tab to view your campaign in real-time personalization:
- You can go ahead and Publish the campaign.