You can send an email from FM and ask the user to click a url to acknowledge or accept something.
That url can be an Otto webhook with value pairs like:
&available=yes&user=xyz123&event=12345.
This is then available in OttoReceiver. This in itself is great.
A downside is that the user is taken to a webpage with something like
{“success”:true,“scriptError”:0,“scriptResult”:{“success”:true},“messageRecordId”:“11”,“successMessage”:“Message Accepted”}.
For each webhook (with a successful scriptResult) could we determine the response, in the Webhook section in Otto?
the default JSON (application/json)
text string (text/plain)
simple html (text/html)
html form with a submit button.
These could just be fields with static responses.
Next level would be combining it with fm data relating to the initial webhook/OttoReceiver trigger.
The response from webhooks is fully customizable via the webhook script response. This can be used to send back simple JSON or build fully customized HTTP responses.
For your various requirements:
just send back the JSON response
send back a JSON response with the following structure:
{
"useScriptResult": true,
"status": 200,
"statusMessage": "OK",
"headers": { "Content-Type": "text/plain" },
"body": "this is a plain text response"
}
3 and 4. send a 307 response to redirect the user to your html page. add some query params if you want to send data along with them:
Then you can fully customize the contents of the strings and forms based on data from your solution based on data in the HTTP response. Does that work for your use case?
And yes, you could put an HTML page into the FMS HTTP folder and just redirect there. You’d need to send along data you want to display in the URL most likely unless you want to build data fetching into the HTML page.