corretti bug sull'invio email
This commit is contained in:
@@ -5,7 +5,7 @@ module Mailings
|
||||
VALUE_MODES = %w[any present blank].freeze
|
||||
|
||||
ARRAY_KEYS = %w[
|
||||
sports team_genders regions provinces streaming_statuses statuses
|
||||
sports countries team_genders regions provinces streaming_statuses statuses
|
||||
send_statuses ab_variants pipeline_stages
|
||||
exclude_received_mailing_ids exclude_opened_mailing_ids
|
||||
].freeze
|
||||
@@ -46,6 +46,7 @@ module Mailings
|
||||
def summary_parts
|
||||
parts = [Catalog.label_for(Catalog::MAILING_AUDIENCES, preset)]
|
||||
parts << "sport: #{Array(@data["sports"]).join(", ")}" if @data["sports"].present?
|
||||
parts << "nazione: #{Array(@data["countries"]).join(", ")}" if @data["countries"].present?
|
||||
parts << "M/F: #{Array(@data["team_genders"]).map { |g| Catalog.label_for(Catalog::TEAM_GENDERS, g) }.join(", ")}" if @data["team_genders"].present?
|
||||
parts << "regione: #{Array(@data["regions"]).join(", ")}" if @data["regions"].present?
|
||||
parts << "provincia: #{Array(@data["provinces"]).join(", ")}" if @data["provinces"].present?
|
||||
|
||||
@@ -44,6 +44,7 @@ module Mailings
|
||||
|
||||
def apply_organization_filters(scope)
|
||||
scope = scope.where(sport: @filters["sports"]) if @filters["sports"].present?
|
||||
scope = scope.where(country: @filters["countries"]) if @filters["countries"].present?
|
||||
scope = scope.where(team_gender: @filters["team_genders"]) if @filters["team_genders"].present?
|
||||
scope = scope.where(region: @filters["regions"]) if @filters["regions"].present?
|
||||
scope = scope.where(province: @filters["provinces"]) if @filters["provinces"].present?
|
||||
|
||||
@@ -48,11 +48,16 @@ class Mailings::OutboundQueue
|
||||
end
|
||||
|
||||
def next_queued
|
||||
# Sceglie il destinatario piu vecchio (per priorita/updated_at) TRA le mailing
|
||||
# la cui finestra di invio e attualmente aperta. Prima si sceglieva il piu vecchio
|
||||
# in assoluto: se apparteneva a una mailing con finestra chiusa, drain_one!
|
||||
# restituiva :closed e si fermava, bloccando l'intera coda condivisa anche per
|
||||
# le mailing senza vincoli orari (bug: coda bloccata da mailing con orario chiuso).
|
||||
queued_scope.order(
|
||||
Arel.sql(
|
||||
"CASE WHEN mailing_recipients.error_message IS NULL OR mailing_recipients.error_message = '' THEN 0 ELSE 1 END, mailing_recipients.updated_at ASC, mailing_recipients.id ASC"
|
||||
)
|
||||
).first
|
||||
).includes(:mailing).find { |r| Mailings::SendClock.new(r.mailing).open? }
|
||||
end
|
||||
|
||||
def queued_scope
|
||||
|
||||
Reference in New Issue
Block a user