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
+20
View File
@@ -110,6 +110,26 @@ class Api::V1::ApiTest < ActionDispatch::IntegrationTest
assert_equal "demo_trial", @opportunity.pipeline_stage
end
test "updates organization email after bounce" do
patch "/api/v1/p/matchlivetv/organizations/#{@org.id}/email",
params: {
organization_id: @org.id,
bounced_email: "vecchia@example.com",
email: "nuova@example.com",
email_invalid: false,
bounce_reason: "User unknown",
activity_subject: "Email aggiornata dopo bounce"
},
headers: bearer(@admin_token.plaintext),
as: :json
assert_response :success
@org.reload
assert_equal "nuova@example.com", @org.email
assert_equal "vecchia@example.com", @org.bounced_email
assert_not @org.email_invalid?
assert json_body["activity"].present?
end
test "rejects lost stage without reason" do
patch "/api/v1/p/matchlivetv/opportunities/#{@opportunity.id}/stage",
params: { pipeline_stage: "lost" },
+1
View File
@@ -27,6 +27,7 @@ class McpControllerTest < ActionDispatch::IntegrationTest
assert_includes listed, "list_projects"
assert_includes listed, "today"
assert_includes listed, "create_activity"
assert_includes listed, "check_mail_bounces"
assert names || listed.any?
end