I have noticed that email types in Administration -> E-Mails are not translated:
This one is a bit trickier, but here’s what I found out.
- The displayed email type comes from this line in the template (for the Sent page):
- The list shows
EmailLog
records, which have anemail_type
field defined here: -
EmailLog
records are created in the jobsNotifyMailingListSubscribers
andUserEmail
. -
UserEmail
jobs (andCriticalUserEmail
jobs, which are a subtype) are queued at different locations with mostly hardcoded email types (found viagrep -R "user_email" .
):
-
app/controllers/finish_installation_controller.rb:
signup
andsignup
-
app/controllers/admin/users_controller.rb:
account_created
-
app/controllers/session_controller.rb:
forgot_password
-
app/controllers/users_controller.rb:
admin_login
andsignup
-
app/jobs/scheduled/enqueue_digest_emails.rb:
digest
-
app/jobs/scheduled/enqueue_mailing_list_emails:
mailing_list
-
app/models/user.rb:
signup_after_approval
-
app/services/user_activator.rb:
signup
-
app/services/notification_emailer.rb:
user_email
-
lib/tasks/admin.rake:
account_created
-
lib/email_updater.rb:
notify_old_email
-
lib/email_updater.rb:
confirm_new_email
,confirm_old_email
andconfirm_new_email
once more via this helper method - any email type passed to
Email::Sender.new(...)
(which creates anEmailLog
here), namely (as indicated bygrep -R "Email::Sender.new" .
):-
app/controllers/admin/email_controller.rb:
digest
-
app/jobs/regular/invite_email.rb:
invite
-
app/jobs/regular/invite_password_instructions_email.rb:
invite_password_instructions
-
app/jobs/regular/notify_mailing_list_subscribers.rb:
mailing_list
-
app/jobs/regular/test_email.rb:
test_message
- app/jobs/regular/user_email.rb: any email type passed
-
app/jobs/scheduled/version_check.rb:
new_version
-
app/jobs/scheduled/pending_queued_posts_reminder.rb:
pending_queued_posts_reminder
-
lib/email/processor.rb:
email_reject_*
-
lib/email/receiver.rb:
subscription
-
app/controllers/admin/email_controller.rb:
(This should be it.)
In general, it would be a good idea to collect the complete list of valid email types (not to be confused with the email template types) at a central place and make these translatable (even though plugins may send emails as well, I suppose, therefore we probably cannot reject email keys that are not in this list, which would assert that this list is to be kept complete).
3 Likes
I’m also curious about all possible email_type
s, because I’m looking into disabling certain email types.
So far, I’ve seen:
signup
forgot_password
mailing_list
test_message
But the code also shows more unusual ones like blah
.
List of types:
- email_reject_reply_user_not_matching
- email_reject_old_destination
- email_reject_inactive_user
- email_login
- user_quoted
- user_mentioned
- email_reject_screened_email
- user_invited_to_private_message
- confirm_old_email
- email_reject_invalid_post_specified
- mailing_list
- admin_confirmation_message
- download_backup_message
- user_private_message
- forgot_password
- admin_login
- email_reject_topic_not_found
- notify_old_email
- invite
- user_replied
- suspicious_login
- email_reject_empty
- confirm_new_email
- user_invited_to_topic
- activation_reminder
- account_suspended
- email_reject_post_too_short
- group_mentioned
- account_second_factor_disabled
- test_message
- signup
- user_watching_first_post
- email_reject_topic_closed
- email_reject_bad_destination_address
- user_posted
- digest
- user_linked
3 Likes