This API is currently pending release and will be available shortly.
Set the email template for a given audit
Method: POST
Request body should be JSON encoded, and can include the following fields:
Property | Definition | Required |
email_template | Object – An object of email template objects (see below) keyed by the ISO locale the template applies to | Yes |
Email template
Each email template object should follow the following structure:
Property | Definition | Required |
subject | String – Subject line of email | Yes |
body | String – Body of email | Yes |
default | Boolean - Whether this template should be used as a fallback, e.g. if there is no template for the user's language | No |
String replacements
The following placeholders can be used in subject lines and body texts, surrounded by square brackets (e.g. [[link]]
) and Insites will automatically replace them with the correct values:
Placeholder | Definition |
name | Customer's name, as entered by the agent in the Insites UI |
business | The best available business name, as detected by Insites (this falls back to the website URL if no business name could be found) |
link | A link to the audit, generated by Insites according to the settings provided by the agent |
score | The two-digit overall score of the audit (e.g. 67) |
agentName | The agent's name, as defined in their profile |
agentJob | The agent's job title, as defined in their profile |
agentPhone | The agent's phone number, as defined in their profile |
bookMeetingLink | The agent's meeting booking link, as defined in their profile |
Example
curl "https://api.insites.com/api/v1/report/[REPORT ID]/email-template" \
--header "api-key:[YOUR API KEY]" \
--header "Content-Type: application/json" \
--data '{
"email_template": {
"en_GB": {
"subject": "Your audit is ready for [[business]]",
"body": "Hi [[name]], \n\nYour audit for [[business]] is ready. \n\nView it by visiting the link below: \n\n[[link]]",
"default": true
},
"fr_FR": {
"subject": "Votre audit est prêt pour [[business]]",
"body": "Bonjour [[name]], \n\nVotre audit pour [[business]] est prêt. \n\nConsultez-le en cliquant sur le lien ci-dessous : \n\n[[link]]"
}
}
}'
Expected response
If successful, you would expect a 201 response.
All possible responses
Code | Reason |
201 | Email template stored |
400 | Malformed input (see response for details) |
404 | Audit does not exist |
422 | Malformed input (see response for details) |
Delete the email template for a given audit
Method: DELETE
Example
curl -X DELETE "https://api.insites.com/api/v1/report/[REPORT ID]/share-email" \
--header "api-key:[YOUR API KEY]"
Expected response
If successful, you would expect a 201 response.
All possible responses
Code | Reason |
200 | Successfully deleted |
400 | Malformed input (see response for details) |
404 | Audit does not exist |