Skip to content

Instantly share code, notes, and snippets.

class GetData
@@logger = Logger.new('log.log')
def initialize
@yesterday = Date.today.prev_day
@token = xxx
end
def get_actions
date = Date.today
scheduler.in '10d' do
something = Something.new(date)
end
class Trial
def check_activity
if activity > 100
send_mail(Mailer)
end
end
def send_mail(mail)
mail.new(id, name, date, total_activity)
end
if trial?
scheduler = Rufus::Scheduler.new
date = Date.today
scheduler.in '10d' do
trial = Trial.new(customer[:id], customer[:name], date)
trial.check_activity
end
end
{
"uid": "1VOa"
}
response:
{
code: 200
status: "Beacon recognized"
name: "Czarny"
<div style="display: none;">
<script type="text/javascript" src="//your.mautic.domain/form/generate.js?id=1"></script>
</div>
<script>
jQuery("input#billing_email").change(function() {
var customer_email = jQuery("input#billing_email").val();
jQuery("input#mauticform_input_yourformname_email").val(customer_email)
jQuery("form#mauticform_yourformname").submit();
})
{# you can replace 'default' with your blog id #}
{% set contents = blog_popular_posts('default', 200) %}
{# search query #}
{% set query = request.query_dict['q'] %}
<h1>Search results for: {{ query }}</h1>
{% for content in contents %}
{% if query|lower in content.name|lower %}
{# your blogpost listing, ex. <h2>{{ content.name }}</h2> #}
<form action="http://example.com/search">
<input type="search" name="q" placeholder="Search">
</form>
Inbound Contacts
Includes
Rule 1
Rule 2
Rule n
Excludes
Rule 1
Rule 2
Rule n
require 'rest-client'
require 'json'
properties = File.open('./hubspot-contact-properties-list-shortened.txt')
request = "http://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=APIKEY&showListMemberships=true&formSubmissionMode=all&count=1000"
properties.each do |property|
request << "&property=#{property}"
end