Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace :matchlivetv do
|
||||
desc "Svuota MatchLiveTV e importa il foglio Campagna 100"
|
||||
task reset_campaign: :environment do
|
||||
path = ENV["CAMPAIGN_CSV"].presence ||
|
||||
Rails.root.join("db/data/matchlivetv_campagna_100.csv")
|
||||
user = User.find_by(email: "admin@simplecrm.local") || User.find_by!(role: "admin")
|
||||
project = Project.find_by!(code: "matchlivetv")
|
||||
|
||||
puts "File: #{path}"
|
||||
result = CampaignImport::MatchlivetvLaunch.new(path: path, user: user, project: project, wipe: true).call
|
||||
puts "Organizzazioni rimosse dal solo MatchLiveTV: #{result.wiped_organizations}"
|
||||
puts "Società importate: #{result.imported}"
|
||||
if result.errors.any?
|
||||
puts "Errori: #{result.errors.size}"
|
||||
result.errors.first(10).each { |err| puts " riga #{err[:line]} #{err[:name]}: #{err[:message]}" }
|
||||
abort "Import incompleto"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user