Import/Export Email Templates
Organization email templates, found under Organization administration > Setup > Organization email templates (up to app ver 8.1 Organization administration > Setup > Email templates), have been enhanced by Docentric and therefore contain some custom data fields. The instructions below will guide you how to export and import Organizational email templates extended by Docentric, using built-in Data management.
Following scenarios will be covered:
- Exporting organizational email templates for all the companies (legal entities) into an external XML file
- Importing email templates from an external XML file
- Copying email templates from one legal entity into one or more other legal entities within the same D365FO environment.
Docentric AX extends the D365FO’s built-in Email templates table (SysEmailTable) with certain set of fields. Two new data entities have been provided to support the data management of the extended tables:
- Docentric organization email templates (DocSysEmailTableEntity)
- Docentric organization email messages (DocSysEmailMessageTableEntity)
Email templates may contain messages larger than 32768 characters. According to D365FO’s documentation, export and import jobs by design use SQL Server Integration Services to fill staging tables. This imposes a limitation that a field imported from an external file can only contain up to 32768 characters. Exceeding content may be truncated. In our test scenarios, however, we were able to perform all export and import without truncation if we chose export to and import from XML file using XML-Element as target data format.
Scenario 1: Export to XML
You want to export all the email headers and related message contents into an XML file – either for backup or to transfer settings into another environment. This can be accomplished by creating an Export Data project in Data management workspace.
- Open the Data management workspace. Make sure you see the Enhanced view, if you don’t you can toggle the view in the left upper corner of the form. Next, click on the Export tile.
- You are now setting up a new export data project. Fill-in the Group name and Description text boxes in the Export tab. You can optionally change the default value in the Project category drop-down list, should you want to further segregate your data projects.
- Next, click on Add entity drop-down list to open the Add entity dialog. Select XML-Element in the Target data format drop-down list.
Do not choose XML-Attribute, because email contents will be hard to read when they span over multiple lines as xml attribute is meant for one-line contents. XML element, however, will display each field in its own element and multi-line contents will be much easier to read.
- Start typing Docentric o in the Entity name text box to see the Docentric organization email entities and select Docentric organization email templates.
- Click the Add button to add this entity to the list of entities for the export.
- Repeat steps 3 to 5 for the Docentric organization email messages. This entity will be added to the list.
Some notification messages might appear informing you about possible data truncation. These messages can be safely ignored in our case.
Now click somewhere outside this dialog to close it.
- Save the data project by clicking the Save button as shown on the figure below. Now the export data project is set up and you can run it by clicking on Export button.
- While the export is being executed you will be able to refresh the status of this export job.
- Now you can download the resulting XML files to your local machine. You just select the data entity in the Entity processing status tab and click Download file. Your browser will now initiate file download. Repeat this for the second data entity as well. The figure below shows this process in Chrome browser.
- Last but not least, you should check the execution log by clicking on View execution log on the upper left part of the window.
Check the Docentric organizational email templates export log first. On the figure above you can see that there is nothing in the Log text text box.
There is nothing in the Log text field as well, meaning there were no warnings or errors.
Scenario 2: Import from XML
You want to import settings from the XML file, formerly exported from the same or from another environment.
- Open the Data management workspace. Make sure you see the Enhanced view, if you don’t you can toggle the view in the left upper corner of the form. Next, click on the Import tile:
- Fill-in the Group name and Description text boxes.
- Now you will choose the first XML file from which you will import. Click on the Add file button in the Selected Entities tab. The Add file dialog opens. Make sure that XML-Element is chosen in the Source data format drop-down list.
The XML file should be added as shown in the figure above. Note the messages at the top.
- Repeat step 3 also for the Docentric organization email messages.
This XML file has been added as well. First three messages at the top tell you that information has been loaded and that the mapping has completed successfully. The warning messages can be ignored.
Click outside of Add file dialog to close it.
- Click Save to save the data import project. To run the import, click the Import button.
- After the import job has finished you should inspect the execution summary, to see if import has been successful and how many records were created and how many updated.
To see even further details, click the View execution log button in the upper part of the window.
- The Execution log form shows import details and log messages, generated during import. Since you imported data from two XML files – email templates and their messages, you see two cards on the left side of the window. As you click on each of these cards, you see their respective log text, generated by the import job. Check this log text for warnings or errors.
- Final check can be made by opening the Organization administration > Setup > Email templates menu.
Scenario 3: Copy from one legal entity into the other(s)
You want to export the email headers and related message contents from one legal entity to one or more other legal entities.
- Open the Data management workspace. Make sure you see the Enhanced view, if you don’t you can toggle the view in the left upper corner of the form. Then click on the Copy into legal entity tile.
- Enter the name and description into the Group name and Description text boxes. Note that the Source legal entity drop-down selection box contains the name of the currently selected legal entity.
- Now select one or more destination legal entities from the drop-down list.
- Click the Add entity drop-down selection box in the Selected entities tab and type Docentric in the Entity name text box to limit the list of entities shown.
Select Docentric organization email templates and click on the Add button.
- Repeat previous step also for the Docentric organization email messages entity. The entity will be added to the list, but with some warnings.
These warnings can be ignored, because the background copy job logic will make sure that fields will not be truncated.
- Now click on the Save menu button to save the changes. You can start this job by clicking on the Copy into legal entity menu button in the menu line in the upper part of the form.
- When the job is finished, you can see its execution summary.
On the image above you can see, that the data has been copied.
- If you are interested in even more details, you can click on the View execution log button, where you can see if any errors or warnings have been recorded during job execution.
In the case above, execution didn’t log any warnings or errors.
Now you can switch to the target legal entity to see the copied email templates.