Aggiunge IMAP bounce e flag email non valide nel CRM.
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:
@@ -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" },
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user