using email templates from .net core/mvc site

lawrence whittemore asked on December 16, 2022 21:00

is there any documentation about setting up email templates that we can use from the mvc site? I am building an emailer to send notifications when a comment is added to a post, and wasn't sure if there would be benefits to using an email template or if I should just code the whole email.

Correct Answer

Brenden Kehren answered on December 16, 2022 21:06

Use them as you would normally. Call the template by a code name, then populate it as you normally would. Then send the email using the queue and the template.

What we typically do is store the Email Template code name as a custom setting we add in a custom module within Kentico. Then we can have the ability to change the template without having to update code.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on December 17, 2022 12:21

Just keep in mind what macros are available in given context. In some cases you can use the EmailSender.SendEmailWithTemplateText method right ahead. In some more complex cases you may just need to get the template info and use it as a "template" to build the email message almost from scratch and then use just the EmailSender.SendEmail method.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.