Importa i prospect Basket senza email vuote e senza toccare le altre campagne.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-07 12:06:07 +02:00
co-authored by Cursor
parent 3e73e708e4
commit a9470d7e77
3 changed files with 289 additions and 2 deletions
@@ -12,6 +12,7 @@ class CampaignImport::MatchlivetvLaunch
"LIMITATO" => "limited",
"SI / PARZIALE" => "yes_partial",
"SI" => "yes",
"RILEVATO" => "yes",
"SI - SPORTCAM" => "yes_sportcam",
"SI SPORTCAM" => "yes_sportcam"
}.freeze
@@ -53,7 +54,7 @@ class CampaignImport::MatchlivetvLaunch
rows.each_with_index do |row, idx|
name = cell(row, "Società")
if duplicate_name?(name)
if duplicate_name?(name) || normalize_email(cell(row, "Email verificata")).blank?
skipped += 1
next
end
@@ -190,7 +191,7 @@ class CampaignImport::MatchlivetvLaunch
end
def normalize_email(value)
email = value.to_s.strip.downcase.gsub(/\s+/, "")
email = I18n.transliterate(value.to_s).strip.downcase.gsub(/\s+/, "")
email.presence
end