
So this is quite annoying. I'm trying to send a email template out using Power Automate. The email template is created against the opportunity.
The email template contains some dynamic content for the contact name of the opportunity and the name of the sales person sending/triggering the power automate flow.
I've bumped into several issues with email templates and the SendTemplate action in Power Automate that you wouldn't normally notice when manually inserting the email template while you compose the email in Dynamics.
Firstly if you create the email template against the opportunity and you've only set the parent contact field for the opportunity to a contact and trigger the Flow. It will send fine. You have to set the recipient to an opportunity as it's a opportunity template.
However if I also add a account to the account field or parentaccount field. The flow then fails because when you set the recipient to a opportunity it will try and grab the email address off the account lookup field instead of the contact. This is so strange as most accounts don't have a email value on their email field.... Power Automate now throws a error "Object address not found on party or party is marked as non-emailable" as account doesn't have a email...
This is quite strange as when I compose a email from the timeline of the opportunity. Regardless of whether I have both the account and contact lookup fields filled. The email To field will always default to the contact....
Another interesting issue is using the Dynamic content for User. I want to add a intro to the email template like:
"Hi my name is <insert user first name here>".
It defaults to the user or owner of the organization email template instead of the modifying user. I have to use the opportunity owner dynamic content instead but that won't work if the opportunity has a account and contact on the lookup fields....
Is there any other solutions to this or will I have to in Power Automate physically create the email record, insert the copy with the HTML and dynamic content and then send it instead of using the template function.