Mailmodo Dynamic Form API
Trigger a campaign whose AMP email carries a form generated at runtime from the request payload
Trigger a campaign whose AMP email carries a form generated at runtime from the request payload
openapi: 3.1.0
info:
title: Dynamic form
version: '1.0'
description: "Create dynamic forms that add or change questions based on triggers in your website or app. For example, a purchase on your website would trigger an email with form questions related to the product purchased by the user. \n\nYou would require mmAPI key, campaign id, form id to configure this API. Follow the help doc to get these details from your Mailmodo account. ( https://help.mailmodo.com/en/articles/146-how-to-get-the-mmapi-key-form-id-and-campaign-id )"
x-source: https://www.mailmodo.com/developers/e7d1abdadacd7-dynamic-form
servers:
- url: https://api.mailmodo.com/api/v1
paths:
/triggerCampaign/{campaign-id}:
parameters:
- schema:
type: string
name: campaign-id
in: path
required: true
post:
summary: Send email with dynamic form
tags:
- Dynamic Form
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
x-examples:
example-1:
success: false
message: The provided email is not a valid email id
properties:
success:
type: boolean
description: 'true'
message:
type: string
minLength: 1
examples:
example-1:
value:
email: john@example.com
subject: Sample Subject Line
data: {}
addToList: ''
forms:
- formId: form120tm57
steps:
- stepId: step4r57953
buttonText: <p><strong>Next</strong></p>
elements:
- type: single-line
inputType: text
properties:
border-color: '#5858e0'
border-width: 1px
elementId: element8wcnc657
title: <p><strong>Name</strong></p>
required: null
placeholder: Your name
- type: single-line
inputType: text
properties:
border-color: '#5858e0'
border-width: 1px
elementId: element6tvhd658
title: <p><strong>Phone Number</strong></p>
required: false
placeholder: '+91'
- stepId: stepbnmby54
buttonText: <p><strong>Submit</strong></p>
elements:
- type: single-select
inputType: radio
properties:
border-color: '#5858e0'
border-width: 1px
elementId: element2qmq9659
title: <p><strong>What is your annual income?</strong></p>
required: false
choices:
- less than 5 lakh
- less than 10 lakh
- less than 15 lakh
- type: date-picker
properties:
border-color: '#5858e0'
border-width: 1px
elementId: element5rbrf660
title: <p><strong>What is your date of birth?</strong></p>
required: false
- stepId: success
buttonText: Success
elements:
- type: success
inputType: text
properties:
border-color: '#5858e0'
border-width: 1px
elementId: elementwhtdx661
title: '<p style="text-align: center;">Thank you for submitting the form</p>'
required: false
btnRequired: true
operationId: post-triggerCampaign-campaign-id
requestBody:
content:
application/json:
schema:
type: object
x-examples:
example-1:
email: john@example.com
subject: Sample Subject Line
data: {}
forms:
- formId: form120tm57
steps:
- stepId: '10009'
buttonText: Submit
elements:
- type: single-line
inputType: text
properties:
border-color: '#5858e0'
border-width: 1px
elementId: '112'
title: First question
required: true
placeholder: First answer
- type: single-line
inputType: text
elementId: '113'
title: Second question
required: true
placeholder: Second answer
btnRequired: true
- stepId: success
buttonText: Know more
elements:
- type: success
inputType: text
properties:
border-color: '#5858e0'
border-width: 1px
elementId: element805us8
title: <p style="text-align:center;">Thank you for submitting the form</p>
required: false
btnRequired: true
properties:
email:
type: string
subject:
type: string
data:
type: object
forms:
type: array
items:
type: object
properties:
formId:
type: string
steps:
type: array
items:
- type: object
properties:
stepId:
type: string
description: Final stepId must be "success" message
buttonText:
type: string
elements:
type: array
items:
type: object
properties:
type:
type: string
inputType:
type: string
properties:
type: object
properties:
border-color:
type: string
border-width:
type: string
elementId:
type: string
title:
type: string
required:
type: boolean
placeholder:
type: string
btnRequired:
type: boolean
- type: object
properties:
stepId:
type: string
buttonText:
type: string
elements:
type: array
items:
type: object
properties:
type:
type: string
inputType:
type: string
properties:
type: object
properties:
border-color:
type: string
border-width:
type: string
elementId:
type: string
title:
type: string
required:
type: boolean
placeholder:
type: string
btnRequired:
type: boolean
description: Forms accept an array
description: This API allows you to send an email with adding form questions at the runtime.
parameters:
- schema:
type: string
in: header
name: mmApiKey
description: Please input your API key available at https://manage.mailmodo.com/app/settings/apikey
required: true
- schema:
type: string
in: header
name: Content-Type
description: application/json
required: true
components:
schemas:
Form:
description: ''
type: object
x-examples:
example-1:
formId: formj0b0l1
steps:
- stepId: stepg87v80
buttonText: 'Submit '
elements:
- type: single-line
inputType: text
properties:
border-color: '#5858e0'
border-width: 1px
elementId: element1gewr3
title: Please enter your name
required: null
- stepId: step2cf941
buttonText: 'Submit '
elements:
- type: multi-select
inputType: checkbox
properties:
border-color: '#5858e0'
border-width: 1px
elementId: elementen15y5
title: Please select an option
required: false
choices:
- option1
mode: radio
otherOptionEnabled: false
- type: rating
inputType: star
properties:
border-color: '#5858e0'
border-width: 1px
maxRating: 10
elementId: elementid3ak6
title: How likely would you recommend this to a friend or colleague?
required: false
- stepId: step26egw2
buttonText: 'Submit '
elements:
- type: date-picker
properties:
border-color: '#5858e0'
border-width: 1px
elementId: element49z2t7
title: Please select a date
required: false
- type: nps
inputType: box
properties:
border-color: '#5858e0'
border-width: 1px
maxRating: 10
elementId: elementgjequ8
title: How likely would you recommend this to a friend or colleague?
required: false
- stepId: success
buttonText: Know more
elements:
- type: success
inputType: text
properties:
border-color: '#5858e0'
border-width: 1px
elementId: elementwomin4
title: '<p style="text-align: center;">Thank you for submitting the form</p>'
required: false
btnRequired: true
properties:
formId:
type: string
minLength: 1
description: You can get the form id from the editor, when you mark a form as "Dynamic Form"
steps:
type: array
uniqueItems: true
minItems: 1
items:
type: object
properties:
stepId:
type: string
minLength: 1
buttonText:
type: string
minLength: 1
elements:
type: array
uniqueItems: true
minItems: 1
items:
type: object
properties:
type:
type: string
minLength: 1
inputType:
type: string
minLength: 1
elementId:
type: string
minLength: 1
title:
type: string
minLength: 1
required:
type: boolean
required:
- type
- inputType
- elementId
- title
- required
btnRequired:
type: boolean
required:
- stepId
- buttonText
- btnRequired
required:
- formId
- steps
title: ''
securitySchemes:
mmApiKey:
name: mmApiKey
type: apiKey
in: header
description: Please get it from the portal
security:
- mmApiKey: []
tags:
- name: Email
- name: Dynamic Form
description: Create dynamic forms that add or change questions based on triggers in your website or app. For example, a purchase on your website would trigger an email with form questions relat