Hello,
I would like to store HTML email templates in a SharePoint site library and pull those templates into a flow, populate them with variable information, then send them with outlook.
The logic seems very simple, but I haven't been able to get the variables to be substituted into the template in the flow; the email is sending with fields like @{variables('Staff Email')} instead of actually using the variables' values. When I copy and paste the template HTML text into a compose action in the flow it sends with the correct information.
Is there a way to do this successfully?
Thanks!
EDIT:
@ScottShearerThank you for your comment. This is an example of what I have already tried:
That last expression is
body('Get_file_content')
And the HTML file consists of
@{variables('Test')}
The email would contain the body @{variables('Test')} instead of Hello, world!
Can you post a screen shot of your email configuration screen from Flow?
I suggest switching back to the original send email action (not V2) and setting is HTML? To yes.
Hi @ScottShearer, thank you for the suggestion.
I just tried using the original Send Email instead, but that had the same result.
Thank you for your help!
Hi @AVividLight ,
This is my test, please check it and see if it helps:
Best Regards,
Hi @v-bacao-msft,
Thank you for your suggestion. I am able to put variables in the email action from the Dynamic Content menu, and HTML is rendered correct when I load it from a file, but the problem that I'm having is when the file content contains a variable, like
Hi @AVividLight ,
If it is a reference to such a variable contained in the file content, I am afraid it will be displayed as plain text.
Because the reference to Dynamic content is similar to expression, either directly refer to Dynamic content in the field, or edit it first in Expression and then apply it to the field.
Best Regards,
User | Count |
---|---|
85 | |
71 | |
44 | |
26 | |
25 |
User | Count |
---|---|
42 | |
25 | |
23 | |
23 | |
17 |