Skip to main content
All CollectionsIntegrations
HubSpot integration
HubSpot integration

Integrate Scribeless with HubSpot to programmatically trigger handwritten mailers for contacts from workflows.

Updated over 2 weeks ago

Connect Scribeless to HubSpot to send personalized handwritten direct mail from workflows when deals close, contacts update, meetings are booked, and more.

Integrate Scribeless with HubSpot to send handwritten mailers programmatically based on triggers and workflows in your HubSpot CRM.


Prerequisites

Before setting up your HubSpot integration:

  • HubSpot Plan Requirement: You need "Operations Professional" to integrate Scribeless & HubSpot directly. For HubSpot Starter plans, consider integrating via Zapier instead.

  • Scribeless Account Access: Ensure you have access to set up recurring campaigns (contact your commercial team if needed)

  • Template Creation: Create a template for your handwritten sends in the Scribeless platform

  • Recurring Campaign: Set up a recurring campaign that will receive recipients from HubSpot (initially in "Pending" status)

  • API Key: Generate an API key in Settings > API Keys section of your Scribeless account


Typical Triggers and Use Cases

  • Deal closed: Send thank you notes to new customers

  • Contact property updated: Welcome new prospects with personalized outreach

  • Birthday or renewal date approaching: Send timely personalized greetings

  • Meeting booked: Follow up after important sales conversations

  • Form submitted: Respond to high-value leads with premium outreach


Creating Your Integration

1. Sign up to the Scribeless platform and create your campaign

  • Create a recurring campaign that will start in "Pending" status

2. Create your HubSpot workflow

  • Navigate to Automation > Workflows in your HubSpot account

  • Create a new workflow or edit an existing one

  • Select the trigger event (contacts, companies, or deals)

  • Add any filters or time delays as needed

  • Set the action to "Custom code"

3. Configure your custom code

Map the relevant properties in HubSpot to the following naming conventions. If done correctly, this will result in the code snippet below working correctly with minimal changes.


Mapping HubSpot properties

Map the relevant properties in HubSpot to the following naming conventions. If done correctly, this will result in the code snippet below working correctly first time, with the only changes you need to make being the API key & Campaign ID.


Custom code

const axios = require('axios').default;

exports.main = async (event, callback) => {
/*****
Use inputs to get data from any action in your workflow and use it in your code
*****/
const campaign_id = "CAMPAIGN_ID" // Replace with your campaign ID
const api_key = "YOUR_API_KEY" // Replace with your API key
const testing = true // Set to false when ready to send real mail

const title = ""
const firstName = event.inputFields['firstName']
const lastName = event.inputFields['lastName']
const company = event.inputFields['company']

const address1 = event.inputFields['address1']
const address2 = ""
const address3 = ""

const city = event.inputFields['city']
const state = event.inputFields['state']
const postalCode = event.inputFields['zip']
const country = event.inputFields['country']

const custom_field_1 = event.inputFields['custom_field_1']
const custom_field_2 = event.inputFields['custom_field_2']


const result = axios.post(`https://platform.scribeless.co/api/recipients`, {
campaignId: campaign_id,
data: [
{
title,
firstName,
lastName,
company,
address: {
address1,
address2,
address3,
city,
state,
postalCode,
country
},
variables: {
custom_field_1,
custom_field_2
}
}
]
},
{
headers: {
'X-API-Key': api_key,
'Content-Type': 'application/json'
}
})

console.log("Result", await result)

/*****
Use the callback function to output data for later workflow actions
*****/
callback({
outputFields: {
}
});
}

Replace CAMPAIGN_ID with the ID of your recurring campaign. This is the last segment in the URL when viewing your campaign in the platform.


Campaign Status and Workflow

When integrating Scribeless with HubSpot, understanding the correct campaign workflow is essential:

Pending Status for Testing

New recurring campaigns start in "Pending" status. This is specifically designed for testing your integration:

  • You can upload recipients against pending campaigns via HubSpot

  • Recipients added to pending campaigns will generate previews

  • These recipients will NOT be processed for printing or mailing

  • No charges will be incurred for recipients in pending campaigns

Use this pending status to verify your data mapping, variable replacement, and overall integration setup.

Activating Your Campaign

Once your testing is complete and you're satisfied with the integration:

  • Navigate to your campaign in the Scribeless platform

  • Activate the campaign to change its status from "Pending" to "Ready"

  • After activation, any new recipients added via HubSpot will:

    • Be processed for production

    • Be printed and mailed according to campaign settings

    • Be charged to your account

Important: There is no separate "testing mode" - the campaign status (Pending vs. Ready) determines whether recipients are processed or not.

Best Practices

  • Always Test with Pending Campaigns: Use the pending status for all testing before activation

  • Verify Address Formatting: Ensure addresses are properly formatted for the destination country

  • Check Variable Mapping: Preview test recipients to confirm variables are replacing correctly

  • Monitor Your Workflow: Regularly check for any errors or issues in your HubSpot workflow

  • Create New Pending Campaigns: For testing new integrations, create new pending campaigns rather than using active ones

Troubleshooting

  • Recipients not appearing: Verify your API key is valid and being correctly passed

  • 401 Unauthorized error: Check that your API key is correctly entered

  • HTTP error responses: Check your JSON formatting and required fields

  • 503 Service Unavailable: This indicates a temporary spike in API traffic; retry your request after a few minutes

  • Address validation errors: Ensure complete address information is being passed from your trigger

  • Campaign not available: Confirm you have Admin access and that the campaign exists

Need Support?

Any issues, concerns, or difficulties you run into - reach out to us through our live chat. We'll hop on a quick call with you to implement and will have you up and running in no time.

For additional help, contact our support team at [email protected]

Did this answer your question?