diff --git a/app/controllers/inbound_emails_controller.rb b/app/controllers/inbound_emails_controller.rb index 711a9042f3..2eac114859 100644 --- a/app/controllers/inbound_emails_controller.rb +++ b/app/controllers/inbound_emails_controller.rb @@ -8,7 +8,7 @@ class InboundEmailsController < ActionController::Base def brevo payload = request.params["items"].first - TransferEmailReplyJob.perform_later(payload) + HandleInboundEmailJob.perform_later(payload) end private diff --git a/app/jobs/transfer_email_reply_job.rb b/app/jobs/handle_inbound_email_job.rb similarity index 98% rename from app/jobs/transfer_email_reply_job.rb rename to app/jobs/handle_inbound_email_job.rb index e41e143f9e..cb90ac3348 100644 --- a/app/jobs/transfer_email_reply_job.rb +++ b/app/jobs/handle_inbound_email_job.rb @@ -1,6 +1,6 @@ # cf /docs/interconnexions/brevo.md -class TransferEmailReplyJob < ApplicationJob +class HandleInboundEmailJob < ApplicationJob queue_as :mailers # Pour éviter de fuiter des données personnelles dans les logs diff --git a/app/mailers/users/file_attente_mailer.rb b/app/mailers/users/file_attente_mailer.rb index ae61cec33b..d99ba9ed4d 100644 --- a/app/mailers/users/file_attente_mailer.rb +++ b/app/mailers/users/file_attente_mailer.rb @@ -24,6 +24,6 @@ def domain end def default_from - TransferEmailReplyJob.reply_address_for_rdv(@rdv) + HandleInboundEmailJob.reply_address_for_rdv(@rdv) end end diff --git a/app/mailers/users/rdv_mailer.rb b/app/mailers/users/rdv_mailer.rb index 57e627983f..24ff690189 100644 --- a/app/mailers/users/rdv_mailer.rb +++ b/app/mailers/users/rdv_mailer.rb @@ -55,6 +55,6 @@ def domain end def default_from - TransferEmailReplyJob.reply_address_for_rdv(@rdv) + HandleInboundEmailJob.reply_address_for_rdv(@rdv) end end diff --git a/spec/jobs/transfer_email_reply_job_spec.rb b/spec/jobs/handle_inbound_email_job_spec.rb similarity index 99% rename from spec/jobs/transfer_email_reply_job_spec.rb rename to spec/jobs/handle_inbound_email_job_spec.rb index 98ec2a8c7a..bf876e31cc 100644 --- a/spec/jobs/transfer_email_reply_job_spec.rb +++ b/spec/jobs/handle_inbound_email_job_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe TransferEmailReplyJob do +RSpec.describe HandleInboundEmailJob do describe "#uuid_from_email_address" do %w[ rdv+b1a2-3c4f@reply.rdv-solidarites.fr diff --git a/spec/requests/inbound_email_spec.rb b/spec/requests/inbound_email_spec.rb index a09cb372fe..76436a33e3 100644 --- a/spec/requests/inbound_email_spec.rb +++ b/spec/requests/inbound_email_spec.rb @@ -13,7 +13,7 @@ it "enqueues the job that handles transferring the email" do expect do receive_brevo_callback - end.to have_enqueued_job(TransferEmailReplyJob).with({ "Subject" => "Dummy email" }).on_queue(:mailers) + end.to have_enqueued_job(HandleInboundEmailJob).with({ "Subject" => "Dummy email" }).on_queue(:mailers) end end