Totally customise email body
I have a script which loops through records in a found set and sends an email for each. That parts easy.
And I know how to customise the body of the email message from within the send email dialogue. Again easy.
And I do this all with the 'perform without dialogue' option which is what I want.
But ... I'm not the end user. I want the different end users to be able to enter their custom message into a layout somewhere and have the email use that instead. Again that's easy until I want to use replaceable text.
For example, if I enter the following DIRECTLY into the message box of the Send Email window I get what I need
"Hello "& subject::name
which gets me Hello John, Hello Sally etc. Great
But my customers may want something different, perhaps not even in English. So I created a global field called BODY in a GeMail table and I call that onto the message box with.
Now the customer could go to the layout with that field and enter their custom message. They may enter
"Dear "& subject::firstname
It no longer works. The emails will just repeat the text verbatim rather than get the firstname for each record.
I hope this makes sense. Note I can get the result I want by importing a text file into the message box but I can't do that automatically with no dialogue.
Please help if possible