Skip to content

Add Rails Mailer previews#5502

Merged
zachmargolis merged 1 commit intomainfrom
margolis-mailer-preview
Oct 14, 2021
Merged

Add Rails Mailer previews#5502
zachmargolis merged 1 commit intomainfrom
margolis-mailer-preview

Conversation

@zachmargolis
Copy link
Contributor

I wanted a way to investigate #5498 (comment), so I remembered this nifty Rails feature: mailer previews!

  1. go to http://localhost:3000/rails/mailers
  2. click a mailer, see a preview!

lets us do cool things like check the plain-text equivalent and see in other languages

description screenshot
list of mailers Screen Shot 2021-10-14 at 9 48 20 AM
individual preview Screen Shot 2021-10-14 at 9 49 03 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to make these route specific? If it's anything like the CSP headers, I worry the development-specific allowances risk giving us a false sense that things are working correctly. That being said, I doubt we'll have much use for frames outside these previews 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an allow-from option, so I can try that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wait allow-from is obsolete: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

would you prefer ALLOWALL or SAMEORIGIN? I feel like they're roughly the same level of risk since in local development everything is from the same origin, so we can't quite list the specific pages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pardon my ignorance of the feature: Is it limited to specific environments out-of-the-box?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's limited to development by default, but I'm not finding any direct documentation, only indirect documentation (ex stackoverflow for enabling it in prod which implies it's not enabled in prod, and this tutorial)

- Include specs to make sure we implement them in the future
@zachmargolis zachmargolis force-pushed the margolis-mailer-preview branch from cfdf799 to e3f8312 Compare October 14, 2021 18:39
@zachmargolis zachmargolis changed the base branch from margolis-lg-4886-interpolate-logingov to main October 14, 2021 18:39
@zachmargolis
Copy link
Contributor Author

Code climate is lagging... going to admin merge

@zachmargolis zachmargolis merged commit 21c9e3e into main Oct 14, 2021
@zachmargolis zachmargolis deleted the margolis-mailer-preview branch October 14, 2021 18:53
zachmargolis added a commit that referenced this pull request Oct 19, 2021
zachmargolis added a commit that referenced this pull request Oct 20, 2021
…5521)

- Follow-up to #5502
- Use made-up User and EmailAddress records for mailer previews

Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants