Open ragesoss opened 2 years ago
See the Course Approval Mailer preview for examples of how to work around mailers that expect records to behave like production records in the database; define_singleton_method
can work around these cases to avoid using any production records in the previews.
Hello @ragesoss, may I work on this one ?
Btw, the Unsubmitted Course Alert Mailer does not work(but I fixed it so the check may stay :) ).
@cyrillefr sure! I know I worked on some of these last year, and there might be some that are already okay and just need to be double-checked.
Current Behavior:
Wiki Education Dashboard sends out a variety of emails in various circumstances. However, these previews are not available in production — only in staging and development environments. Also, the staging environment — https://dashboard-testing.wikiedu.org/rails/mailers — is not necessarily up-to-date, not all the previews work (because some previews expect example records to be available in the database), and some could reveal private information if enabled on production (because, for example, they use the most recent record of a given type that's in the database).
Desired Behavior:
Mailer previews should be available in production, and should work either without relying on live records from the database or should ensure that only public information is used to generate the previews.
Previews checked for privacy and database independence