auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
this.data = {
email: "nancy.davolio@gmail.com",
message: "Please check form submission",
visitor_name: "Nancy Davolio",
bla: "bla field"
}
An object with the form's data.
async
(params, auths) => {
}
//See the API docs: https://help.formspree.io/hc/en-us/articles/360013470814-Submit-forms-with-JavaScript-AJAX-
if (!params.data) {
throw new Error("Must provide data parameter.");
}
return await require("@pipedreamhq/platform").axios(this, {
url: `https://formspree.io/f/${auths.formspree.hash_id}`,
method: "post",
headers: {
Authorization: `Bearer ${auths.formspree.api_key}`,
Accept: "application/json"
},
data: params.data
});