Letter with dynamic content input

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
morrellaberdeen
User
Posts: 187

Letter with dynamic content input

Post by morrellaberdeen »

I wish to develop a letter in which certain parts are dynamic values that can come from a database. For example, the letter can say, Dear John Doe. However, the name John Doe is placed dynamically from the database. I was hoping to use the eckeditor. However, when i place code into the source of the editor, it converts to html and displays literally. I would be happy for any suggestions as to how this can be done.


csmgomes
User
Posts: 105

Post by csmgomes »

If text is always the same, except for the dynamic values, what I do is create a report with a custom template. I then use the search box to find the record I want and then I can export it.


morrellaberdeen
User
Posts: 187

Post by morrellaberdeen »

Yes, the text is always the same, except for the dynamic values which i want to automatically input from the person's record, stored in the database.

How do I get those dynamic values into the various parts of the letter? Is that where the search you mention comes in? If so, can you give some more details?


arbei
User
Posts: 9419

Post by arbei »

You can use tags to represent the dynamic content (e.g. {{name}}) in the template so that you identify and replace them with the actual content later.


csmgomes
User
Posts: 105

Post by csmgomes »

morrellaberdeen wrote:
Yes, the text is always the same, except for the dynamic values which i
want to automatically input from the person's record, stored in the
database.

How do I get those dynamic values into the various parts of the letter? Is
that where the search you mention comes in? If so, can you give some more
details?~

It's like arbei said, using tags to call those dynamic fields, on the custom template.
The search is only after all done, when I want to call/see the specific record to export it :)


sticcino
User
Posts: 1043

Post by sticcino »

use a template library like smarty, it will give you much more control and flexibility


Post Reply