diff --git a/apps/notification/backend/infra/rabbitmq/async_client.py b/apps/notification/backend/infra/rabbitmq/async_client.py index 61456b7..70b9143 100644 --- a/apps/notification/backend/infra/rabbitmq/async_client.py +++ b/apps/notification/backend/infra/rabbitmq/async_client.py @@ -8,7 +8,8 @@ import aio_pika class AsyncMQClient: # TODO: change to freeleaps.notification.exchange.{} # in local test, we use freeleaps.notification.exchange.local.{} to avoid repeating sending emails - exchange_name_format = "freeleaps.notification.exchange.local.{}" + #exchange_name_format = "freeleaps.notification.exchange.local.{}" + exchange_name_format = "freeleaps.notification.exchange.{}" exchange_type = "direct" def __init__(self, channel_name: str) -> None: diff --git a/apps/notification/tests/integration_tests/README.md b/apps/notification/tests/integration_tests/README.md index 77afe94..4c99f13 100644 --- a/apps/notification/tests/integration_tests/README.md +++ b/apps/notification/tests/integration_tests/README.md @@ -33,4 +33,11 @@ tenant_notification.py ```shell # run the command python test_tenant_notification_real.py -``` \ No newline at end of file +``` +After running the commands, email will be sent + +## Q & A +### Q: Why is the email sent twice? +### Q: Why do I recieve 2 identical emails at the same time + +### A: in infra/rabbitmq/async_client.py, use exchange_name_format = "freeleaps.notification.exchange.local.{}" for local environment, while exchange_name_format = "freeleaps.notification.exchange.{}" for alpha environment. \ No newline at end of file