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) => { | |
var phone = event.inputFields['phone']; | |
console.log("Input Phone: ", phone) | |
const outputFields = { | |
valid: false, | |
validation_message: "", | |
phone: "" | |
} |
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
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
// Wait for the form to load | |
setTimeout(function() { | |
var urlInput = document.querySelector('input[name="url_of_page"]'); | |
if (urlInput) { | |
console.log('url_of_page input exists'); | |
urlInput.value = window.location.href; | |
} | |
},1000); // Adjust the delay if needed |
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) => { | |
let originalString = 'TEXTGOESHERE'; | |
let updatedString = originalString.replace(/<br>/g, ';') | |
let nextupdatedString = updatedString.replace(/<(?=\s*[^a-zA-Z\/])/g, '****'); | |
let nextnextupdatedString = nextupdatedString.replace(/<[^>]*>|#nextsteps| /g, '') | |
let finalString = nextnextupdatedString.replace(/\*\*\*\*/g, '<'); | |
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'); | |
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 }); | |
} |
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'); | |
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
{# 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
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
{% 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 %} |