sofn-xyz/mailing

Plaintext templates

pstoica opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
I currently have two templates per email, one HTML and one plaintext. Auto-converting isn't ideal since links must be embedded (no anchors) and you may need to establish hierarchy a little differently (such as using text-based dividers or ordering things more manually).

Describe the solution you'd like
You should be able to define a single template with a plaintext version.

Describe alternatives you've considered
Maintaining two separate template components and previews.

Thanks for the idea @pstoica , I think this could be implemented similarly to the way we do subjects on the templates right now (recent feature that is not documented yet, but you can see how it works in the example templates here:

AccountCreated.subject = ({ name }) => `Welcome to BookBook, ${name}!`;
or in the tests here:
it("should use subject from the component - subject is function", async () => {
)

We'd be happy to take a look at a PR for this if you want to take a stab at it!