Skip to content

Instantly share code, notes, and snippets.

View chrisoklepke's full-sized avatar

Chriso Klepke chrisoklepke

View GitHub Profile
@flexgrip
flexgrip / pass-parameters-with-hubspot-forms.js
Created January 13, 2017 19:55
Pass the GET parameters / url variables / query string, from a hubspot form to your redirect/thank-you page. Apparently, to do this now, you have to manually define the redirect url in the script. It's not exposed in hsContext anymore.
/**
* Append the form data from a HubSpot form automatically
* to the redirect URL query parameters. These values can
* then be used on the form to modify the user experience
* of the Thank You page
*
* LICENSE
* Form redirect
* Written in 2015 by Mike Axiak <maxiak@hubspot.com>
* Updated in 2016 by Seth Meranda <seth.meranda@cune.edu>
@jackcoldrick90
jackcoldrick90 / associateContactToCompany.js
Last active March 27, 2024 08:28
This custom code snippet can be used to associate a contact to a company based on the company name property that is stored at a contact level. It's particularly useful if your customers are using a freemail address and aren't supplying a company website - just the name of their company. If no company is found a new record will be created in the …
// Import the Hubspot NodeJS Client Library - this will allow us to use the HubSpot APIs
const hubspot = require('@hubspot/api-client');
/*
This function is called when the custom code action is executed. It takes 2 arguements. The first is the event object which contains information on the currently enrolled object.
The second is the callback function which is used to pass data back to the workflow.
*/
exports.main = (event, callback) => {
// Instantiate a new HubSpot API client using the HAPI key (secret)
@TheWebTech
TheWebTech / CMS-hub-grid.css
Created May 10, 2022 21:22
HubSpot CMS - styles to better visualize the grid
/* CSS styles that highlight the hubspot grid components so you can better visualize what is happening in a page.
1. You could use this a few different ways, you could add this to your inspector-stylesheet.css when inspecting a page.
2. You could integrate this into a browser extension ;)
3. You could literally upload the stylesheet to HubSpot, and use {% if request.query_dict.hsDebug == "true" %}{{ require_css(PATH TO YOUR CSS FILE) }}{% endif %}
Additionally in-case it's useful as a prototyping/layout planning tool: https://codepen.io/thewebtech/pen/bGdrQyN??editors=1100
*/
.dnd-module {background: #eaf0f6;min-height: 50px!important; }
.dnd-module::before {content:"{% dnd_module %}";}