Skip to content

Commit

Permalink
E-mails : passage à @transport.data.gouv.fr (#3552)
Browse files Browse the repository at this point in the history
* E-mails : passage à @transport.data.gouv.fr

* Update missing test
  • Loading branch information
AntoineAugusti authored Oct 23, 2023
1 parent 8b32a75 commit 898e4ec
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion apps/shared/test/validation/gbfs_validator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule GBFSValidatorTest do

assert [
{"content-type", "application/json"},
{"user-agent", "contact@transport.beta.gouv.fr"}
{"user-agent", "contact@transport.data.gouv.fr"}
] == headers

assert String.starts_with?(url, "https://gbfs-validator.netlify.app")
Expand Down
26 changes: 13 additions & 13 deletions apps/transport/test/transport/data_checker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ defmodule Transport.DataCheckerTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn _from_name, from_email, to_email, _reply_to, subject, body, _html_body ->
assert from_email == "contact@transport.beta.gouv.fr"
assert to_email == "deploiement@transport.beta.gouv.fr"
assert from_email == "contact@transport.data.gouv.fr"
assert to_email == "deploiement@transport.data.gouv.fr"
assert subject == "Jeux de données supprimés ou archivés"
assert body =~ ~r/Certains jeux de données disparus sont réapparus sur data.gouv.fr/
:ok
Expand Down Expand Up @@ -101,8 +101,8 @@ defmodule Transport.DataCheckerTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn _from_name, from_email, to_email, _reply_to, subject, body, _html_body ->
assert from_email == "contact@transport.beta.gouv.fr"
assert to_email == "deploiement@transport.beta.gouv.fr"
assert from_email == "contact@transport.data.gouv.fr"
assert to_email == "deploiement@transport.data.gouv.fr"
assert subject == "Jeux de données supprimés ou archivés"
assert body =~ ~r/Certains jeux de données ont disparus de data.gouv.fr/
:ok
Expand Down Expand Up @@ -139,8 +139,8 @@ defmodule Transport.DataCheckerTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn _from_name, from_email, to_email, _reply_to, subject, body, _html_body ->
assert from_email == "contact@transport.beta.gouv.fr"
assert to_email == "deploiement@transport.beta.gouv.fr"
assert from_email == "contact@transport.data.gouv.fr"
assert to_email == "deploiement@transport.data.gouv.fr"
assert subject == "Jeux de données supprimés ou archivés"
assert body =~ ~r/Certains jeux de données sont indiqués comme archivés/
:ok
Expand Down Expand Up @@ -242,8 +242,8 @@ defmodule Transport.DataCheckerTest do
# a first mail to our team
Transport.EmailSender.Mock
|> expect(:send_mail, fn _from_name,
"contact@transport.beta.gouv.fr" = _from_email,
"deploiement@transport.beta.gouv.fr" = _to_email,
"contact@transport.data.gouv.fr" = _from_email,
"deploiement@transport.data.gouv.fr" = _to_email,
_reply_to,
"Jeux de données arrivant à expiration" = _subject,
body,
Expand All @@ -259,7 +259,7 @@ defmodule Transport.DataCheckerTest do
# a second mail to the email address in the notifications config
Transport.EmailSender.Mock
|> expect(:send_mail, fn _from_name,
"contact@transport.beta.gouv.fr" = _from_email,
"contact@transport.data.gouv.fr" = _from_email,
^producer_email = _to_email,
_reply_to,
"Jeu de données arrivant à expiration" = _subject,
Expand Down Expand Up @@ -305,9 +305,9 @@ defmodule Transport.DataCheckerTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^email = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"Jeu de données arrivant à expiration" = _subject,
"" = _plain_text_body,
html_part ->
Expand Down Expand Up @@ -343,9 +343,9 @@ defmodule Transport.DataCheckerTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^email = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"Nouveaux jeux de données référencés" = _subject,
plain_text_body,
"" = _html_part ->
Expand Down
12 changes: 6 additions & 6 deletions apps/transport/test/transport/jobs/consolidate_bnlc_job_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ defmodule Transport.Test.Transport.Jobs.ConsolidateBNLCJobTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr" = _display_name,
"contact@transport.beta.gouv.fr" = _from,
"deploiement@transport.beta.gouv.fr" = _to,
"contact@transport.beta.gouv.fr" = _reply_to,
"contact@transport.data.gouv.fr" = _from,
"deploiement@transport.data.gouv.fr" = _to,
"contact@transport.data.gouv.fr" = _reply_to,
"[OK] Rapport de consolidation de la BNLC" = _subject,
"",
html_part ->
Expand Down Expand Up @@ -660,9 +660,9 @@ defmodule Transport.Test.Transport.Jobs.ConsolidateBNLCJobTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr" = _display_name,
"contact@transport.beta.gouv.fr" = _from,
"deploiement@transport.beta.gouv.fr" = _to,
"contact@transport.beta.gouv.fr" = _reply_to,
"contact@transport.data.gouv.fr" = _from,
"deploiement@transport.data.gouv.fr" = _to,
"contact@transport.data.gouv.fr" = _reply_to,
"[ERREUR] Rapport de consolidation de la BNLC" = _subject,
"",
html_part ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ defmodule Transport.Test.Transport.Jobs.DatasetNowOnNAPNotificationJobTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^email,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"Votre jeu de données a été référencé sur transport.data.gouv.fr",
"",
html_content ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ defmodule Transport.Test.Transport.Jobs.DatasetsClimateResilienceBillNotLOLicenc

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"deploiement@transport.beta.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"deploiement@transport.data.gouv.fr",
"contact@transport.data.gouv.fr",
"Jeux de données article 122 avec licence inappropriée",
"",
html_content ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ defmodule Transport.Test.Transport.Jobs.DatasetsSwitchingClimateResilienceBillJo

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^email,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"Loi climat et résilience : suivi des jeux de données" = _subject,
"" = _plain_text,
html ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ defmodule Transport.Test.Transport.Jobs.DatasetsWithoutGTFSRTRelatedResourcesNot

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"contact@transport.data.gouv.fr",
"contact@transport.data.gouv.fr",
"Jeux de données GTFS-RT sans ressources liées" = _subject,
plain_text_body,
"" = _html_part ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ defmodule Transport.Test.Transport.Jobs.MultiValidationWithErrorNotificationJobT

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"[email protected]" = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
"",
html ->
Expand All @@ -153,9 +153,9 @@ defmodule Transport.Test.Transport.Jobs.MultiValidationWithErrorNotificationJobT

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^reuser_email,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
"",
html ->
Expand All @@ -171,9 +171,9 @@ defmodule Transport.Test.Transport.Jobs.MultiValidationWithErrorNotificationJobT

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"[email protected]" = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
"",
html ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ defmodule Transport.Test.Transport.Jobs.NewDatagouvDatasetsJobTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn _from_name,
"contact@transport.beta.gouv.fr" = _from_email,
"deploiement@transport.beta.gouv.fr" = _to_email,
"contact@transport.data.gouv.fr" = _from_email,
"deploiement@transport.data.gouv.fr" = _to_email,
_reply_to,
"Nouveaux jeux de données à référencer - data.gouv.fr" = _subject,
body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ defmodule Transport.Test.Transport.Jobs.NewDatasetNotificationsJobTest do

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^email = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"Nouveaux jeux de données référencés" = _subject,
plain_text_body,
"" = _html_part ->
Expand Down
4 changes: 2 additions & 2 deletions apps/transport/test/transport/jobs/oban_logger_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ defmodule Transport.Test.Transport.Jobs.ObanLoggerTest do
# Should be sent when failing at the last attempt
Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"[email protected]" = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"Échec de job Oban : Transport.Test.Transport.Jobs.ObanLoggerJobTag" = _subject,
plain_text_body,
"" = _html_part ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ defmodule Transport.Test.Transport.Jobs.PeriodicReminderProducersNotificationJob

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^email = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
"",
html ->
Expand Down Expand Up @@ -249,9 +249,9 @@ defmodule Transport.Test.Transport.Jobs.PeriodicReminderProducersNotificationJob

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^email = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
"",
html ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ defmodule Transport.Test.Transport.Jobs.ResourceUnavailableNotificationJobTest d

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"[email protected]" = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
_plain_text_body,
html_part ->
Expand All @@ -156,9 +156,9 @@ defmodule Transport.Test.Transport.Jobs.ResourceUnavailableNotificationJobTest d

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
^reuser_email = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
_plain_text_body,
html_part ->
Expand All @@ -174,9 +174,9 @@ defmodule Transport.Test.Transport.Jobs.ResourceUnavailableNotificationJobTest d

Transport.EmailSender.Mock
|> expect(:send_mail, fn "transport.data.gouv.fr",
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
"[email protected]" = _to,
"contact@transport.beta.gouv.fr",
"contact@transport.data.gouv.fr",
subject,
_plain_text_body,
html_part ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ defmodule Transport.Test.Transport.Jobs.ResourcesChangedNotificationJobTest do

assert_email_sent(fn %Swoosh.Email{} = sent ->
assert %Swoosh.Email{
from: {"transport.data.gouv.fr", "contact@transport.beta.gouv.fr"},
from: {"transport.data.gouv.fr", "contact@transport.data.gouv.fr"},
to: [{"", ^email}],
reply_to: {"", "contact@transport.beta.gouv.fr"},
reply_to: {"", "contact@transport.data.gouv.fr"},
subject: "Super JDD : ressources modifiées",
text_body: nil,
html_body: html_body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ defmodule TransportWeb.ContactControllerTest do
|> refute

assert_email_sent(
from: {"PAN, Formulaire Contact", "contact@transport.beta.gouv.fr"},
to: "contact@transport.beta.gouv.fr",
from: {"PAN, Formulaire Contact", "contact@transport.data.gouv.fr"},
to: "contact@transport.data.gouv.fr",
subject: "dataset",
text_body: "where is my dataset?",
html_body: nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ defmodule TransportWeb.FeedbackLiveTest do
|> assert

assert_email_sent(
from: {"Formulaire feedback", "contact@transport.beta.gouv.fr"},
to: "contact@transport.beta.gouv.fr",
from: {"Formulaire feedback", "contact@transport.data.gouv.fr"},
to: "contact@transport.data.gouv.fr",
subject: "Nouvel avis pour on-demand-validation : j’aime",
text_body:
"Vous avez un nouvel avis sur le PAN.\nFonctionnalité : on-demand-validation\nNotation : j’aime\nAdresse e-mail : \n\nExplication : so useful for my GTFS files\n",
html_body: nil,
reply_to: "contact@transport.beta.gouv.fr"
reply_to: "contact@transport.data.gouv.fr"
)
end

Expand Down
6 changes: 3 additions & 3 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ config :transport,
max_import_concurrent_jobs: (System.get_env("MAX_IMPORT_CONCURRENT_JOBS") || "1") |> String.to_integer(),
nb_days_to_keep_validations: 60,
join_our_slack_link: "https://join.slack.com/t/transportdatagouvfr/shared_invite/zt-2n1n92ye-sdGQ9SeMh5BkgseaIzV8kA",
contact_email: "contact@transport.beta.gouv.fr",
bizdev_email: "deploiement@transport.beta.gouv.fr",
contact_email: "contact@transport.data.gouv.fr",
bizdev_email: "deploiement@transport.data.gouv.fr",
tech_email: "[email protected]",
security_email: "contact@transport.beta.gouv.fr",
security_email: "contact@transport.data.gouv.fr",
transport_tools_folder: Path.absname("transport-tools/")

# For now, never send session data (containing sensitive data in our case) nor params,
Expand Down

0 comments on commit 898e4ec

Please sign in to comment.