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
// Import Axios library for easier HTTP Requests | |
const axios = require('axios'); | |
exports.main = (event, callback) => { | |
const first_name = event.inputFields['first_name']; | |
const last_name = event.inputFields['last_name']; | |
const recipient_name = `${first_name} ${last_name}`; |
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
// Import Axios library for easier HTTP Requests | |
const axios = require('axios') | |
exports.main = (event, callback) => { | |
const first_name = event.inputFields['first_name']; | |
const last_name = event.inputFields['last_name']; | |
const recipient_name = `${first_name} ${last_name}` |
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
{ | |
"letter_template_id": "1873", | |
"message": "Hi {{ first_name|title|default:'' }},\nWe love having you as a customer and hope you're enjoying our product as much as we like making it! As a 'thank you', here is a coupon code for 15% off the next 3 months of your subscription! \n\nSUMMER15\n\nScan the QR code on the front of the card and enter this code to take advantage of it!\n\nThanks again!\n-Emily from Acme Inc.", | |
"font": "pea", | |
"recipient_name": "{{ first_name|title|default:'' }} {{ last_name|title|default:'' }}", | |
"recipient_company_name": "", |
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
api_key: [[VaLIdAPiT0K3NT0WPKPxJA-2_V2Iy9anZ48_x6O4x]] | |
letter_template_id: [[32]] | |
font: [[nelson]] | |
message: [[Hi {{ first_name|default:'' }}, | |
We love having you as a customer and hope you're enjoying our product as much as we like making it! As a 'thank you', here is a coupon code for 15% off the next 3 months of your subscription! |
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
api_key: [[VaLIdAPiT0K3NT0WPKPxJA-2_V2Iy9anZ48_x6O4x]] | |
letter_template_id: [[32]] | |
font: [[nelson]] | |
message: [[Hi Bob, | |
We thought you might want to check out some of our | |
recent case studies and testimonials! If you have a | |
moment, we would love to connect and show you how |
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
user_ids = [6 | |
9, | |
11, | |
15, | |
34, | |
35, | |
43, | |
62, | |
65, | |
77, |
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
package_skus = PackageSku.where('client_id is not null') | |
saved_skus = {} | |
package_skus.find_each do |sku| | |
if sku.sku_type != 'custom' | |
sku.sku_type = 'custom' | |
saved_skus[sku.id] = sku.save | |
end | |
end |
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
coach_ids = SET_OF_IDS_FROM_OUR_COACH_ROSTER | |
coaches = Coach.where(id: coach_ids) | |
candidate_client_users = CoachUserClientUser.where(coach_user: coaches.map(&:user)).where(available_training_session_count: 0).pluck(:client_user_id) | |
| |
# First time flow | |
# send to all candidate clients | |
| |
candidate_client_users.find_each do |user| | |
RebookRequestViaSmsSender.send_sms(user) | |
end |
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
flags = Flag. | |
of_ongoing_conversation. | |
unresolved. | |
within_date_range(Statistic::START_OF_BUSINESS..Time.zone.local(2016, 2, 2, 23, 59, 59)) | |
flags.find_each do |flag| | |
flag.take_no_action! |
NewerOlder