Using Template as a string instead of a document


#1

Is there a way to use a string for a template rather than an actual document? I have some areas in my project where the user can specify email templates and would like to use the assembly to create the actual content using the merged fields and functions. Instead of specifying a document as a template and receiving a document as output, it would be nice to have an option to specify a string that has the template source (like an HTML string with placeholders) and receive a string as the output. That way the developer can have more control over database storage of string values instead of storing documents.


#2

@keith.lewis

Thanks for contacting us, GroupDocs.Assembly is an API engine designed to generate documents based on templates. In essence, the engine accepts a template document and some data, assembles data with the template document as per syntax defined by the template document and then, generates the output document in the same format as of the template document format.

Currently, you have to use a document as a template and you cannot use a string as a template. However, we shall investigate the possibility of adding the feature of using a string as a template and getting a string as output. We shall notify you in case of any updates.

Thanks,


#3

Thanks for the input. I understand that the Assembly works with documents as templates and that is a powerful engine that I use throughout my application. It works well for what it is designed for. I was just asking the question because now I am adding some additional features for allowing users to draft email templates and that is stored as an HTML string that the user can use snippets to add merge fields into the email body. The Assembly document structure and template syntax is quite powerful and it took some end users time to fully understand it and now they are asking that it be incorporated in the email template syntax that I am developing. I thought I would request the feature to allow for the string input / string output because it doesnt seem to be a big change in the way you are working with documents.


#4

@keith.lewis

Thanks for a quick response, we noticed your desired requirement of using a string as an input/output template and logged your scenario as an investigation in our internal issue tracking system. We shall update you in case of any further progress.

Regards,


#5

@keith.lewis

Please share the platform you are using for GroupDocs.Assembly(.NET or Java). Furthermore, please share the version of the API you are currently using.

Thanks,