2 Replies Latest reply on Aug 28, 2015 12:40 PM by simonpcooper

    Need help creating scripts for emailing specific fields.

    user311

      Need help creating scripts for emailing specific fields. I'm trying to create buttons (scripts) for emailing content from "field x" to the emails in "field y". any help with the syntax needed in filemaker to create this script would be greatly helpful. I also want to have each email templated with custom text but first I need to get the script to pull the data and email properly.

        • 1. Re: Need help creating scripts for emailing specific fields.
          erolst

          In the Send Mail step you can specify the "To:" with a calculation or a direct field reference: in your case, use the latter choice to select "field y".

           

          To get your mail body right, you should study how the Calculation Engine works, and how one can combine ("concatenate") field and variable references with static ("literal") text; a simple example:

           

          "Dear " & User:.nameFirst &

          ",¶¶" &

          "please find enclosed the draft for our new marketing campaign:" &

          "¶¶" &

          MarketingMaterial::latestCampaignDraft


          You could also calculate this body text someplace else (a field, a variable in the script) in the same way, then reference it here.

          • 2. Re: Need help creating scripts for emailing specific fields.
            simonpcooper

            ... and to deal with the From field it is possible to use the SMTP settings from the send mail script step.

             

            You may want to use a common (global?) SMTP account for sending but specify the Name, email address and reply-to addresses from the source record.

             

            Screen Shot 2015-08-28 at 3.36.39 PM.png