-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add optional bulk mailer settings #35203
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
Conversation
To make room for an actual `BulkMailer`. It is a rails convention that all mailer class names end on `Mailer`.
This will need a documentation PR to add those configuration variables and an explanation on when they are used |
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.
Looks good overall, just a tiny typo in a test description!
Really lovely yaml here.
|
We did, having everything in a specific class seemed cleaner to us.
Yes, existing translations are unfortunately invalidated. Crowdin should suggest them for the renamed strings, though. |
Well, the new
Yes, there is a problem. Crowdin only picks up the english locale and will notice new keys that will all have to be translated again in all other locales. We do not know of a way to tell Crowdin that those keys only moved in an automated way. Seems like this will require some manual work in Crowdin. Happy to hear if you know of a better way. |
Sounds good. I don't have a strong opinion on which way is better. Glad it was considered. Using Separately - on top of the crowdin changes, are there any implications to running/queued mailers that are in place before the rename? I know in previous PRs we'd resisted changing the method signature/naming of some of them out of concern for breaking retries.
If we could solve the "renames and signature changes might break queues" issue, I think a good refactor at some point would be to separate all of the "inherited from devise" vs "our own creations" emails within this mailer into two mailers. Would reduce the LOC of the large user mailer, and I suspect would also be a nice code cleanup on the helpers/params/subjects/i18n front, because those tend to behave consistently between the devise and non-devise methods. |
Excellent point. It's a rather minor concern because those are uncommonly-used features and not part of any release yet (although they are part of betas!), but this is all true. |
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.
In theory, could we not keep the templates and strings where they are now, and just reference them explicitly from the new mailer?
Adds a second set of environment variables prefixed `BULK_SMTP..` that can be used to set a different smtp configuration for bulk emails (i.e. non-transactional emails that might be sent to many users).
2bba114
to
999f1a2
Compare
I rewrote this without introducing a new mailer. This removes the need to move i18n keys and solves the problem of previously enqueued jobs. I moved the logic into its own concern, so it could be re-used in other mailers (sadly, As Matt pointed out, this makes the diff smaller, a lot smaller. And we could still tackle the bigger refactor later, e.g. when we have a third type of "bulk mail". |
Fixes MAS-462
We have two types of emails (server announcements and terms of service changes) that can be sent to many users at once. Turns out some transactional email service providers do not like this and require you to use different SMTP settings for these kinds of emails.
This change moves those mails into their own mailer, which will use different SMTP settings if available.
Those new settings work exactly as the existing ones, but are prefixed with
BULK_
.