This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Existing = inputData.existing_values; | |
let Existing_Labels = inputData.existing_labels; | |
let Looped_Output = ""; | |
Existing = Existing.split(","); | |
Existing_Labels = Existing_Labels.split(","); | |
for (let i = 0; i < Existing.length; i++) { | |
Looped_Output += '{\n "label": "' + Existing_Labels[i] +'", \n"value": "' + Existing[i] + '"\n},\n'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cloneId = inputData.cloneId; | |
let token = inputData.token; | |
let auth = 'Bearer ' + token; | |
fetch('https://api.hubapi.com/marketing-emails/v1/emails/'+ cloneId , { | |
headers: {authorization: auth} | |
}) | |
.then(function(res) { | |
return res.text(); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// RETRIEVE THE CURRENT DROPDOWN VALUES FOR THE LINE-ITEM PROPERTY | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'https://api.hubapi.com/crm/v3/properties/deal/line_items', | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => '', | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var axios = require('axios'); | |
const auth = 'Bearer ' + process.env.ADD_YOUR_SECRET_KEY_NAME_HERE; | |
exports.main = async (event, callback) => { | |
var data = JSON.stringify({ | |
"filterGroups":[ | |
{ | |
"filters":[ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set used_ids = [1, 2, 3, 5, 6] %} | |
{% set new_ids = [1, 2, 4, 5, 7, 8] %} | |
{% set ids_to_use = new_ids|difference(used_ids) %} | |
{% for id in ids_to_use %} | |
{{id}} | |
{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.main = async (event, callback) => { | |
const old_plan_amount = event.inputFields['old_plan_amount']; | |
const new_plan_amount = event.inputFields['new_plan_amount']; | |
if(old_plan_amount == new_plan_amount) { | |
callback({ | |
outputFields: { | |
delta: 'none' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# NOTE THESE CAN ALL BE ADJUSTED TO USE PLACEHOLDER VALUES INSTEAD OF DEFINED IN THE CODE #} | |
{# START AND END TIMES FOR THE EVENT #} | |
{% set google_start_time = "T230000Z" %} | |
{% set google_end_time = "T240000Z" %} | |
{% set outlook_start_time = "T23:00:00+00:00"|urlencode %} | |
{% set outlook_end_time = "T24:00:00+00:00"|urlencode %} | |
{# STATIC VALUES - DEFINED #} | |
{% set event_title = "Sample webinar title"|urlencode %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
exports.main = async (event, callback) => { | |
try { | |
// Replace with secret name | |
const auth = process.env.SAMPLESECRETNAME; | |
// Replace variables below as needed | |
const hsObjectId = event.inputFields['hs_object_id']; | |
const cpa = event.inputFields['cpa____']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- REMEMBER 'USE MODULE FOR PROGRAMMABLE EMAIL' MUST BE SELECTED --> | |
<!-- RETRIEVE PAYLOAD DATA FROM CONTACT RECORD --> | |
{% set cart_items = contact.abandoned_cart_json_payload | fromjson %} | |
<!-- HEADER ROW --> | |
<table style="width: 100%; border-collapse: collapse;"> | |
<tr> | |
<th style="width: 20%; text-align: left; font-weight: bold; border: none;"></th> | |
<th style="width: 60%; text-align: left; font-weight: bold; border: none;"></th> | |
<th style="width: 10%; text-align: right; font-weight: bold; border: none;">Qty</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const crypto = require('crypto'); | |
exports.main = async ({ body }, sendResponse) => { | |
if(body.event == 'endpoint.url_validation'){ | |
try { | |
sendResponse({ body: {encryptedToken: crypto.createHmac('sha256', 'TOKEN ADDED HERE').update(body.payload.plainToken).digest('hex'), plainToken: body.payload.plainToken}, statusCode: 200 }); | |
} catch(e){ | |
sendResponse({ body: e, statusCode: 200 }); | |
} |