Did anyone implemented an elegant email template in this framework?
Are there 3rd party email templates solution in C#?
Thanks.
9 Answer(s)
-
0
I would create HTML files like MyHelloTemplate.en.html , MyHelloTemplate.fr.html, MyHelloTemplate.tr.html check the user's language to pick up the right template. And a template content can be like below;
Hello <CustomerName>, Wellcome to the system! Your registration ends on <EndDate>
And replace all <*> strings with the values you get from entities. Then send via email. That's it!
-
0
@alper - thank you. While it works for templates you predefined, it would not work if you want non programmer to change template content.
I found a good directory of prebuild template system. Maybe Zero can adopt one? <a class="postlink" href="http://nugetmusthaves.com/Tag/Templating">http://nugetmusthaves.com/Tag/Templating</a>
-
0
Hi Vlad, Take a look at Postal: [http://aboutcode.net/postal/]). I have used this before with Hangfire. Save your template data from a wysiwyg component and load it into a cshtml file by passing a TemplateId to the Postal send email method. The Hangfire bit allows you to do this asynchronously.
-
0
in my solution, you can present the HTML files to the user for editing. You can use a WYSIWYG editor.
-
0
@alper - do you mean, that you suggest to store those user custom template on the server or in database? What about upgrades or multihost system?
@bobIngham - thanks for the link,I will check out.
I just think a framework like zero should have an easy to use/customize email, and static content system.
-
0
we should have simple email template with mail merge
-
0
@faisalalam - does it mean its on the list for next release?
-
0
hi, I mean you can store it in database with UserId or TenantId. So that you can filter templates by a specific user/tenant. Something like this AppEmailTemplates table has UserId, HtmlContent And you'll have some predefined placeholders like <DateNow>, <NameSurname>, <SubscriptionEndDate> etc...
-
0
@alper - thanks. yes, we are on the same page. for sure it can be build. i am happy to wait for next release if its on your roadmap.
besides entity and db mapping, one needs to make sure its used just in time when needed.
in addition, it would be nice to allow flexible template config, so API can be used to send emails via backend by tenants.