In this Mover Tip I will describe how you can turn an email into a multi-component Enterprise Print Article (wcml file).
In this case we will save the Article using the email's subject as the "header" and its body the Article's "body".
Here are the Tasks:
1. Get Mail Task: saving each email into a folder I called "newMail". The rest of the settings are pretty straight forward and are mainly based on your email service requirements but you will need to check the "Save to XML File" option. (See Appendix H of the User Guide for more info). You will probably also want to check the "Delete Mail from Server" option so that you do not re-process the files each time the Process runs.
2. Delete Files Task: Each email is going to not only be saved as xml but there will also be a text (.txt) version file.... which we do not need and thus want to delete. So set the Task's Source folder to the same "newMail" folder from Task 1, along with "Delete Immediately" and "File Name Matches Regular Expression" of:
3. XSL Transform Task: Set the Source folder again to the same "newMail" folder from Task 1 and the Destination to what I called "wcmlFiles".... using this "MakeWCMLfromEmailXML.xsl" file. This magical transformation file takes each xml email and converts it into a valid wcml file.
Part of that magic is a Mover feature that allows some Tasks (XSL Transform, Move Files & Enterprise XML Upload) to replace the literal text "%GUID%" with an actual GUID (global unique identifier). These GUIDs are an important part of wcml files and are required to work within Enterprise.
4. Rename Files Task: Even though the newly transformed files in the "wcmlFiles" folder are wcml, they still have an xml extension... So set the From to:
and the To to:
This simply replaces the xml extension with wcml for each file.
5. Enterprise Upload Task: Set the Source to "wcmlFiles" folder from Task 4, deleting the original and upload it to the desired Brand, Category and optional Channels & Issues.
So now we have an Enterprise multi-component Article for each email we receive.
We could eliminate steps 3, 4 and replace 5 with an Enterprise XML Upload Task. Although this would require a very different xsl transformation file.
Important notice: This example and code is provided for reference only. It is provided "AS IS," without warranties of any kind. Feel free to use it as a basis to create your own implementation. Do not contact WoodWing Support with questions and issues about this sample. Please post questions and remarks to this thread.
Please sign in to leave a comment.