How to send template based email using Azure communication service?

smart 20 Reputation points
2023-06-30T02:39:09.4433333+00:00

I want to send email based template. So I want to have templates in separate files.

ex: assets/templates/email_template.html.

Now I am using @azure/communication-email javascript library.

Is it possible?

User's image

This is HtmlEmailContent interface from @azure/communication-email library.

I don't have an idea how to use the email template from a separate file.

Azure Communication Services
0 comments No comments
{count} votes

Answer accepted by question author
  1. SnehaAgrawal-MSFT 22,721 Reputation points Moderator
    2023-07-03T06:51:52.1033333+00:00

    @smart

    Thanks for reaching here! ACS Email does not natively offer templates support but if you can manage templates externally, you can definitely load the full email content from the file into a string variable in memory and assign that to the html property of an HtmlEmailContent object to send the email.

    Please let us know if further query or assistance is required.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.