Editable emails templates
Hi there π
I need users to be able to edit email templates, something like:
Hello {{ first_name }},
Please advice, thanks π
This is a pretty large project :) I assume you want a model called email_templates. Then I think you want a "rich_text_field" with name body_html (or similar). Then you will want to use something like the liquid templating language to parse and replace {{ variable_name }} when rendering said template.
Resources
If you are just letting them change a few things like the subject, maybe disclaimer text, etc you can probably get by with a user_email_templates
table with columns that map to those variables. Then when you go to send the email...simply load the template and inject the variables (with erb)
Thanks Casey π
Those are the same resources that I manged to find. They are outdated so I thought maybe there are newer resources I'm not able to find, for example "effective_email_templates" gem is no longer maintained.
You are most welcome. The resources I listed are not recommendations to install and use :) They are reference material so you can see examples of how others have done similar tasks concretely and with documentation. The idea being if you need to rebuild all or a portion of those solutions you have some pretty solid inspiration.