August 11, 200817 yr Dear (name field) Thanks for buying "(item field)" on (date field) from our web site. Problem? Email us Edited August 12, 200817 yr by Guest
August 11, 200817 yr I would think that you would want to have a series of global fields, e.g. 'textBlock1', 'textBlock2', etc. that you can merge in a calculation to include the Name fields and other specific data. By putting the text into global fields your users can edit the text of the letter without having to redefine the calculations.
August 11, 200817 yr ... and I might add that you will probably want to keep the letter as simple as possible. Otherwise your calculation will get very complicated as it might require a series of conditionals (e.g. 'If not IsEmpty(textBlock2)', result1, result2... etc.) to deal with minor issues such as empty fields, or even grammatical variations such as plurals.
August 11, 200817 yr Author I thought of that but it restricts the edit ability of the email. Maybe they don't want the (name field) in there at all. Maybe they want the order of the fields to be different. I know you can do a merge field in a text box in layout mode and I guess I'm trying to figure something like that but in browse mode.....
August 11, 200817 yr I immediately thought of Ray's demo, Ray Cologon Merge Demo . But, you mention html. You cannot send html email from FM without a plugin (SMTPit Pro or 360Works are two I've used successfully). Or, see this Custom Function, From Brian Dunning's Custom Functions
August 12, 200817 yr Author I immediately thought of Ray's demo, Ray Cologon Merge Demo . But, you mention html. You cannot send html email from FM without a plugin (SMTPit Pro or 360Works are two I've used successfully). Or, see this Custom Function, From Brian Dunning's Custom Functions Using SMTPit Pro and maybe the later will work. I'm going home but I tried throwing in Brian's real quick. I got the "?" in my calc field. I'm wondering if the HTML with it's ", >, < and = is throwing if off.... Thanks for all your help on both topics! Edited August 12, 200817 yr by Guest
August 12, 200817 yr Author Using SMTPit Pro and maybe the later will work. I'm going home but I tried throwing in Brian's real quick. I got the "?" in my calc field. I'm wondering if the HTML with it's ", >, < and = is throwing if off.... Yeah the custom function works fine with straight text but I need to use HTML also. I wonder if this calc can be adjusted to escape them? Also checking out the Nightwing stuff.... Did and it's not what I need either. Edited August 12, 200817 yr by Guest
August 13, 200817 yr Author Ok, so I went with the custom function: FieldNames2FieldValues ( Text ) http://www.briandunning.com/cf/826 Let ([openMacrosPosition = Position ( Text; "{{" ; 1 ; 1 ); closeMacrosPosition = Position ( Text; "}}" ; 1 ; 1 ); macrosContents = Middle ( Text; openMacrosPosition + 2 ; closeMacrosPosition - openMacrosPosition - 2); replacementText = GetField ( macrosContents ); res = Replace ( Text ; openMacrosPosition ; closeMacrosPosition - openMacrosPosition + 2 ; replacementText ); macroscount = PatternCount ( res ; "{{" ) ]; If ( macroscount=0 ; res; FieldNames2FieldValues (res) ) ) The use of "{{}}" instead of "<<>>" to specify merge fields allows for the use of HTML in the text field without altering any of the HTML code. So: Dear {{buyers name}} Here's your order info: Purchase Date: {{purchase date}} Order # : {{order id}} Returns a text field with merged data: Dear {John Here's your order info: Purchase Date: 7/15/2008 Order # : 17362659-01 Using SMTPit I can shoot out the emails !
Create an account or sign in to comment