{
  "schema_version": "1.0.0",
  "id": "hubspot-lead-welcome-email",
  "title": "Send a form lead into HubSpot and a welcome email",
  "category": "lead-gen-crm",
  "difficulty": "beginner",
  "featured": true,
  "description": "Create or update the HubSpot contact from a Jotform submission, add it to the welcome list, and send a personal welcome email from Gmail.",
  "tags": [
    "leads",
    "hubspot",
    "jotform",
    "gmail",
    "welcome-email"
  ],
  "apps": [
    "Jotform",
    "Code by Zapier",
    "HubSpot",
    "Gmail"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger"
    ]
  },
  "tasks": {
    "typical": 4,
    "max": 4
  },
  "trigger": {
    "app": "Jotform",
    "event": "New Submission",
    "kind": "instant",
    "title": "New enquiry submission",
    "why": "Fires on each submission of the enquiry form.",
    "config": {
      "Form": "Book a discovery call"
    },
    "outputs": [
      "submission_id",
      "created_at",
      "full_name",
      "email",
      "phone",
      "company",
      "service",
      "how_heard"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "name",
      "kind": "code",
      "app": "Code by Zapier",
      "event": "Run JavaScript",
      "title": "Split the full name",
      "why": "Gives HubSpot first and last name, and gives the email a first name to greet.",
      "code": {
        "language": "javascript",
        "module": "split-name",
        "file": "code/split-name.js"
      },
      "input_data": {
        "full_name": "{{trigger.full_name}}"
      },
      "outputs": [
        "first_name",
        "last_name",
        "display_name"
      ]
    },
    {
      "key": "contact",
      "kind": "action",
      "app": "HubSpot",
      "event": "Create or Update Contact",
      "title": "Create or update the contact",
      "why": "Matches on email, so the same person submitting twice is one contact.",
      "fields": {
        "Email": "{{trigger.email}}",
        "First Name": "{{name.first_name}}",
        "Last Name": "{{name.last_name}}",
        "Phone Number": "{{trigger.phone}}",
        "Company Name": "{{trigger.company}}",
        "Lifecycle Stage": "lead",
        "How did you hear about us (custom property)": "{{trigger.how_heard}}"
      },
      "outputs": [
        "id",
        "is_new"
      ]
    },
    {
      "key": "list",
      "kind": "action",
      "app": "HubSpot",
      "event": "Add Contact to List",
      "title": "Add the contact to the welcome list",
      "why": "The static list is how you see, later, who went through this Zap.",
      "fields": {
        "List": "Website enquiries: welcome sent",
        "Contact Email": "{{trigger.email}}"
      },
      "outputs": [
        "id"
      ]
    },
    {
      "key": "welcome",
      "kind": "action",
      "app": "Gmail",
      "event": "Send Email",
      "title": "Send the welcome email",
      "why": "Sent from your own Gmail, so replies land in your inbox and the thread looks personal.",
      "fields": {
        "To": "{{trigger.email}}",
        "Subject": "Thanks {{name.first_name}}, got your note about {{trigger.service}}",
        "Body Type": "plain",
        "Body": "Hi {{name.first_name}},\n\nThanks for getting in touch about {{trigger.service}}. I read every enquiry myself and will reply properly within one working day.\n\nIf it is easier, pick a time for a 20-minute call here: YOUR_BOOKING_LINK\n\nYOUR_NAME\nYOUR_BUSINESS_NAME",
        "From Name": "YOUR_NAME"
      },
      "outputs": [
        "id",
        "thread_id"
      ]
    }
  ]
}
