-
Notifications
You must be signed in to change notification settings - Fork 0
Add email client to send emails via celery tasks #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/mailpit-integration
Are you sure you want to change the base?
Add email client to send emails via celery tasks #33
Conversation
| raise | ||
|
|
||
| multiplicator = BACKOFF_EXPONENTIAL_GROWTH_BASE**self.request.retries | ||
| countdown_in_seconds = email.context.backoff_in_seconds * multiplicator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird for me that the email has the information about the backoff. We are tying email data with celery data. Same for max retries.
This should probably be a parameter of this function independent from email.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get what you mean.
The intention behind the context field is to represent metadata related to the email, which can be used by the different clients to customize behavior. This can range from the error message that needs to be generated upon failed delivery, to, in this case, the backoff value. Perhaps simply metadata would have been a better name for the field.
We could create an email metadata class by itself and pass the email and metadata objects as different arguments, but then the metadata would lose its association with the correct email object, which feels off to me.
Alternatively, we can set the backoff and growth base as env variables and have them apply to all emails. Perhaps we don't need to be able to customize those values individually for each particular email? The previous implementation suggested that such versatility was intended, as it attempted to configure independent env variables for each kind of email.
What do you think?
Uh oh!
There was an error while loading. Please reload this page.