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
2.3.3 :045 > y = x['stats_by_domain'] | |
=> "{\"gmail.com\"=>{\"sent\"=>42053, \"delivered\"=>42038, \"viewed\"=>7725, \"clicked\"=>608, \"hard_bounce\"=>1, \"unsub\"=>33, \"complaints\"=>0, \"unique_views\"=>5469, \"unique_clicks\"=>546, \"soft_bounces\"=>14}, \"yahoo.com.br\"=>{\"sent\"=>1872, \"delivered\"=>1872, \"viewed\"=>420, \"clicked\"=>25, \"hard_bounce\"=>0, \"unsub\"=>3, \"complaints\"=>0, \"unique_views\"=>300, \"unique_clicks\"=>22, \"soft_bounces\"=>0}, \"hotmail.com\"=>{\"sent\"=>2677, \"delivered\"=>1991, \"viewed\"=>363, \"clicked\"=>48, \"hard_bounce\"=>0, \"unsub\"=>3, \"complaints\"=>0, \"unique_views\"=>290, \"unique_clicks\"=>43, \"soft_bounces\"=>686}, \"ymail.com\"=>{\"sent\"=>24, \"delivered\"=>24, \"viewed\"=>1, \"clicked\"=>0, \"hard_bounce\"=>0, \"unsub\"=>0, \"complaints\"=>0, \"unique_views\"=>1, \"unique_clicks\"=>0, \"soft_bounces\"=>0}, \"live.com\"=>{\"sent\"=>43, \"delivered\"=>36, \"viewed\"=>1, \"clicked\"=>0, \"hard_bounce\"=>0, \"unsub\"=>0, \"complaints\"=>0, \"unique_vi |
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
reate_table "sib_transacs", force: :cascade do |t| | |
t.integer "requests" | |
t.integer "delivered" | |
t.integer "bounces" | |
t.integer "spamreports" | |
t.integer "blocked" | |
t.integer "invalid_sent" | |
t.integer "deferred" | |
t.integer "opens" | |
t.integer "unique_opens" |
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
def sib | |
@sib ||= Mailin.new("URL","APIKEY") | |
end | |
def shoot_criteria_gmail_e_cia_collecte | |
{ "aggregate" => 0, "tag" => "WM-ABD-2018-GMAIL-E-CIA-COLLECTE", "days" => 3 } | |
end | |
def shoots_gmail_e_cia_collecte | |
@shoots_gmail_e_cia_collecte ||= sib.get_statistics(shoot_criteria_gmail_e_cia_collecte) | |
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
undefined method `tag' for [:requests, 0]:Array |
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
def update | |
def db_campaign | |
@db_campaign = DbCampaign.find_by_id(params[:id]) | |
end | |
respond_to do |format| | |
@db_campaign = DbCampaign.find_by_id(params[:id]) | |
if @db_campaign.update(db_campaign_params) | |
format.html { redirect_to @db_campaign, notice: 'Campaign was successfully updated.' } | |
format.json { render :show, status: :ok, location: @db_campaign } | |
calculate_kpi |
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
{"requests"=>5851, "delivered"=>5656, "bounces"=>194, "invalid"=>11, "deferred"=>46, "opens"=>2705, "unique_opens"=>1500, "clicks"=>158, "unique_clicks"=>140, "date"=>"2017-11-25", "tag"=>"WM-ABD-2018-GMAIL-E-CIA"} |
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
def index | |
# Set Scenario for the Dashboard | |
# | |
# Excludes campaigns that belongs to "Un Jour Une Astuce" program | |
ids_to_exclude = [864, 5, 7, 866, 8, 994, 868, 14, 870, 15, 17, 11, 16, 21, 23, 24, 25, 31, 20, 871, 29, 30, 27, 38, 1540, 34, 35, 37, 33, 872, 41, 43, 65, 42, 46, 47, 48, 995, 45, 873, 51, 53, 874, 50, 875, 58, 876, 59, 55, 877, 63, 878, 64, 61, 879, 68, 69, 67, 880, 73, 885, 74, 71, 881, 77, 79, 76, 882, 83, 883, 84, 81, 884, 101, 886, 103, 99, 887, 106, 107, 996, 105, 888, 110, 111, 127, 109, 889, 116, 1653, 1566, 113, 890, 119, 120, 891, 118, 892, 124, 125, 126, 123, 893, 132, 894, 129, 895, 135, 136, 146, 134, 896, 141, 897, 906, 138, 898, 145, 899, 143, 900, 151, 1571, 157, 149, 902, 154, 155, 156, 153, 904, 907, 161, 193, 1631, 909, 166, 911, 1482, 164, 1636, 169, 170, 171, 168, 913, 174, 176, 1497, 173, 1638, 179, 180, 563, 178, 915, 183, 184, 1588, 182, 917, 187, 188, 564, 186, 919, 192, 921, 190, 923, 197, 925, 195, 927, 202, 929, 200, 931, 206, 935, 204, 937, 209, 210, 224, |
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
def update | |
respond_to do |format| | |
@single_shoot = DbCampaign.find_by_id(params[:id]) | |
if @single_shoot.update(db_campaign_params) | |
format.html { redirect_to @single_shoot, notice: 'Campaign was successfully updated.' } | |
format.json { render :show, status: :ok, location: @single_shoot } | |
calculate_kpi | |
else | |
format.html { render :edit } | |
format.json { render json: @single_shoot.errors, status: :unprocessable_entity } |