Aggiunge IMAP bounce e flag email non valide nel CRM.
CI / scan_ruby (push) Failing after 13m27s
CI / scan_js (push) Successful in 11m45s
CI / lint (push) Failing after 12m4s

Permette di leggere i bounce dalla stessa MailIdentity SMTP, aggiornare le email in anagrafica e saltare gli indirizzi invalidi nei mailing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-08 19:46:04 +02:00
co-authored by Cursor
parent 353ace4d99
commit 36b3ffe507
26 changed files with 922 additions and 12 deletions
@@ -0,0 +1,11 @@
class AddEmailInvalidToOrganizationsAndContacts < ActiveRecord::Migration[8.1]
def change
add_column :organizations, :email_invalid, :boolean, default: false, null: false
add_column :organizations, :bounced_email, :string
add_column :contacts, :email_invalid, :boolean, default: false, null: false
add_column :contacts, :bounced_email, :string
add_index :organizations, :email_invalid
add_index :contacts, :email_invalid
end
end
@@ -0,0 +1,7 @@
class AddImapSettingsToMailIdentities < ActiveRecord::Migration[8.1]
def change
add_column :mail_identities, :imap_host, :string
add_column :mail_identities, :imap_port, :integer, default: 993, null: false
add_column :mail_identities, :imap_enabled, :boolean, default: true, null: false
end
end
Generated
+10 -1
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2026_09_02_220000) do
ActiveRecord::Schema[8.1].define(version: 2026_09_08_184500) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
@@ -79,9 +79,11 @@ ActiveRecord::Schema[8.1].define(version: 2026_09_02_220000) do
end
create_table "contacts", force: :cascade do |t|
t.string "bounced_email"
t.datetime "created_at", null: false
t.bigint "created_by_id"
t.string "email"
t.boolean "email_invalid", default: false, null: false
t.string "first_name", null: false
t.string "last_name", null: false
t.string "mobile"
@@ -94,6 +96,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_09_02_220000) do
t.datetime "updated_at", null: false
t.bigint "updated_by_id"
t.index ["email"], name: "index_contacts_on_email"
t.index ["email_invalid"], name: "index_contacts_on_email_invalid"
t.index ["last_name", "first_name"], name: "index_contacts_on_last_name_and_first_name"
t.index ["organization_id"], name: "index_contacts_on_organization_id"
t.index ["phone"], name: "index_contacts_on_phone"
@@ -107,6 +110,9 @@ ActiveRecord::Schema[8.1].define(version: 2026_09_02_220000) do
t.string "encryption", default: "starttls", null: false
t.string "from_email", null: false
t.string "from_name", null: false
t.boolean "imap_enabled", default: true, null: false
t.string "imap_host"
t.integer "imap_port", default: 993, null: false
t.string "name", null: false
t.string "reply_to"
t.string "smtp_authentication", default: "plain", null: false
@@ -247,12 +253,14 @@ ActiveRecord::Schema[8.1].define(version: 2026_09_02_220000) do
create_table "organizations", force: :cascade do |t|
t.string "address"
t.bigint "assigned_user_id"
t.string "bounced_email"
t.string "city"
t.text "commercial_fit"
t.string "country", default: "Italia", null: false
t.datetime "created_at", null: false
t.bigint "created_by_id"
t.string "email"
t.boolean "email_invalid", default: false, null: false
t.string "lead_source"
t.string "legal_name"
t.integer "list_position"
@@ -276,6 +284,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_09_02_220000) do
t.index ["city"], name: "index_organizations_on_city"
t.index ["country"], name: "index_organizations_on_country"
t.index ["email"], name: "index_organizations_on_email"
t.index ["email_invalid"], name: "index_organizations_on_email_invalid"
t.index ["lead_source"], name: "index_organizations_on_lead_source"
t.index ["list_position"], name: "index_organizations_on_list_position"
t.index ["name"], name: "index_organizations_on_name"