When you need to send Emails from Dataverse and have a specific format, you can use the Email Template component. Although this is not a new feature, most of us still using this, and just recently I stumbled into a situation where in one of the environments, there are lots of Unmanaged layers found in the Email Templates. And as you know, when there is an unmanaged layer found, if there is a new version of the Email Template being introduced from the Dev, it will not take the latest version which causes the problem. So today, I’ll explore how to find a way to update the version or get rid of the unmanaged layer.
Solution Setup In Environment 1
I create a new Solution layer in one of my environments. Then I created below Email Template:
Here are the Solution and the Email Templates I prepared for the demo:
Import In Environment 2
Once the customizations are ready on the dev environment > export the solution as managed > import the solution to Environment 2. After importing, I open one of the Email Template and update the content:
When we click the Save button, the Email Template will become Unmanaged. Dataverse itself can remove the Unmanaged layer (for Form, Ribbon, etc) that you can read here. But unfortunately, not all components support it. And one of them is Email Template. When you try to delete the Unmanaged layer, you will encounter the error below (RemoveActiveCustomization is not supported for components of type Template):
Because the Email Template is like a record in CRM/Dataverse, I tried to delete the Email Template with the Unmanaged layer (if there is a component dependent on the Email Template, you will get an error):
After successfully deleting the Email Template, we can re-import the solution again. Here is the solution layer of the Email Template that previously had an Unmanaged layer (there is no unmanaged layer anymore 😎):
You also can uninstall the solution and re-import again to remove the Active layers of the Email Template (if your organization group the solutions by the component type. Eg Email Templates, plugins, web resources, etc.).