fix(email sending): guidance for use of exchange
This commit is contained in:
parent
59e8c06078
commit
5b727cb51c
@ -8,7 +8,8 @@ import aio_pika
|
|||||||
class AsyncMQClient:
|
class AsyncMQClient:
|
||||||
# TODO: change to freeleaps.notification.exchange.{}
|
# TODO: change to freeleaps.notification.exchange.{}
|
||||||
# in local test, we use freeleaps.notification.exchange.local.{} to avoid repeating sending emails
|
# 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"
|
exchange_type = "direct"
|
||||||
|
|
||||||
def __init__(self, channel_name: str) -> None:
|
def __init__(self, channel_name: str) -> None:
|
||||||
|
|||||||
@ -34,3 +34,10 @@ tenant_notification.py
|
|||||||
# run the command
|
# run the command
|
||||||
python test_tenant_notification_real.py
|
python test_tenant_notification_real.py
|
||||||
```
|
```
|
||||||
|
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.
|
||||||
Loading…
Reference in New Issue
Block a user