FormSpree - Submit Form
@sergio
code:
data:privatelast updated:3 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
nodejs
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
}
8
this.data =  {
    email: "nancy.davolio@gmail.com",
    message: "Please check form submission",
    visitor_name: "Nancy Davolio",
    bla: "bla field"
  }
steps.
formspree_submit_form
Submits a form with the specified data.
auth
(auths.formspree)
params
Data

An object with the form's data.

 
key
 
value
object ·params.data
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
}
17
//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
});