11 Replies Latest reply on Jun 16, 2010 2:57 PM by ryan

    Emailing from a layout?

    Tony_2010

      Title

      Emailing from a layout?

      Post

       

      Hi 

       

      I use FIlemaker Pro (currently Filemaker Pro 10) for managing client details using a series of layouts within a single database. I would like to be able to email contents of a particular layout (including field information) by clicking a single button on that layout. Can this be done with Filemaker Pro?

       

      Thanks.

       

      Tony.

        • 1. Re: Emailing from a layout?
          ryan

          Hi Tony,

          Yes it can be done.

           

          Have you any experience with Scripting?

           

          And, can you supply an example of the fields you want to include in the message body and how you want it read?

           

          Thanks

          • 2. Re: Emailing from a layout?
            Tony_2010

             

            Thanks for getting back to me. Although I've used Filemaker for some time now, I've never used scripting.

            -------------------------------------

            Example fields:

            Client first name: [David]

            Client surname: [Jones]

            Event date: [12-08-10]

            Event address: [12 Brook Street, London W1]

            Event start time: [2.00pm]

            Event end time: [8.00pm]

            -------------------------------------

            Example email:

            Hi [Client first name]

             

            Thank you for confirming your booking with us on [Event date] at [Event address]. We will arrive at [Event start time] and leave shortly after [Event end time]. etc etc...

            -------------------------------------

             

            • 3. Re: Emailing from a layout?
              ryan

              If you want to manually click a button and send an email to that particular record/clien, it's a very simple script, followed by creating a button.

               

              Under 'Scripts', select 'ScriptMaker'.  Create a New Script.  For my example, i'm just going to call it "Send_Mail".

               

              From the left-hand list of Script Steps available, Scroll all the way near the bottom under Misc. and select "Send Mail".

               

              Click on Specify. That will open a "Send Mail Options" window.

               

              If you need to Setup your SMTP options, read this link: http://help.filemaker.com/app/answers/detail/a_id/6991/kw/smtp%20options

               

              Select the "One email using data from the current record" radio button.

               

              For the "TO" field, click on the arrow to the right and select "Specify Field Name."  select the Email Address Field you have already established.

               

              For the "MESSAGE" part of the email, click the arrow and select "Specify Calculation".  Your calculation will look something like this:

               

              "Hi " & [Client First Name] & ¶

               

              "Thank you for booking with us on " & [Event date] & " at " & [Event address] & ".  We will arrive at " & [Event start time] & " and leave shortly after " & [Event end time] & " ......"

               

              Once your Calculated message is established, click OK and be sure to check the "Perform without Dialog" box in the Scriptmaker window.  Close the window and be sure to SAVE the script.

               

               

               

              Enter Layout mode and go the layout you'd like to have the Button placed.

              Creat the Button.

               

              Once you draw the button on the layout the "button setup" window will pop-up.  Select "Perform Script" from the left (it's the second one down from the top).

               

              then Click on Specify and select the "Send_Mail" script, or whatever you decided to call it.

               

              Enter Browse mode and all should work

               

               

              • 4. Re: Emailing from a layout?
                Tony_2010

                Thanks, this has been a great help. 

                 

                One question though... On my email message I am getting a 'space' at the beginning of each line (except for the first line). How can I stop this?

                • 5. Re: Emailing from a layout?
                  ryan

                  Can you post your Calculated message so i can review it?

                  • 6. Re: Emailing from a layout?
                    Tony_2010

                     

                    I created the following script:

                     

                    "Hi " & PWVAP_111::Name & "¶

                    Thank you for confirming your booking with us on " & PWAP_111::Event date & " at¶

                    " & PWAP_111::Event address & "."

                     

                    Which produced the following email message:

                     

                    Hi Tony
                     Thank you for confirming your booking with us on 19-06-2010 at
                     The Gallery.

                     

                     

                    (Please note the unwanted spaces at the beginning of lines 2 and 3).

                     

                     

                    -----------------

                     

                    I also have another question...

                     

                    For each event the client can select from a list of optional services we provide. Let's call these: Service1, Service2, Service etc.

                     

                    If they only selected services 1 and 3, how can I get my email text to display:

                     

                    Service1: £50

                    Service3: £75

                     

                    rather than:

                     

                    Service1: £50

                    Service2: 

                    Service3: £75

                     

                     

                     

                     

                    • 7. Re: Emailing from a layout?
                      ryan

                       


                      Tony_2010 wrote:

                       

                      I created the following script:

                       

                      "Hi " & PWVAP_111::Name & "¶

                      Thank you for confirming your booking with us on " & PWAP_111::Event date & " at¶

                      " & PWAP_111::Event address & "."

                       

                      Which produced the following email message:

                       

                      Hi Tony
                       Thank you for confirming your booking with us on 19-06-2010 at
                       The Gallery.

                       

                       

                      (Please note the unwanted spaces at the beginning of lines 2 and 3).

                       

                       

                      -----------------

                       


                       

                      Remove the 'spaces' between the ¶ and text.  So it shoud look like this:

                      "Hi " & PWVAP_111::Name &

                      "¶Thank you for confirming your booking with us on " & PWAP_111::Event date & " at¶"

                      & PWAP_111::Event address & "."


                      • 8. Re: Emailing from a layout?
                        ryan

                        For the other question:

                         

                        Create a Calculated Field and use the LIST Function:

                         

                        List ( Services_Field )

                         

                        This will return the list of Selected Services

                        • 9. Re: Emailing from a layout?
                          ryan

                          and to clarify/add:

                           

                          you can also bypass the creation of a new field and use the same LIST function in your message calculation. 

                           

                          For instance:

                           

                          "Hi " & [Client First Name] &

                           

                          "¶Thank you for booking with us on " & [Event date] & " at " & [Event address] & ".  We will arrive at " & [Event start time] & " and leave shortly after " & [Event end time] & " etc.,......"  & List ( Services_Field )

                          • 10. Re: Emailing from a layout?
                            Tony_2010

                             

                            I have now been able to write a script and email directly from a layout. So thanks, really appreciate your help.

                             

                            I'm struggling a bit though with:

                             

                            Create a Calculated Field and use the LIST function

                             

                            Can you please provide more step-by-step notes to help work through this. Thanks again!

                            • 11. Re: Emailing from a layout?
                              ryan

                              Hi Tony_2010,

                               

                              No problem.  Glad to help.

                               

                              Firstly, may i ask:  Do you need this field for other reasons, or just for the body of the email?

                              Not that's my business, but if it's just for the email message, then you don't need to worry about creating the field and can just use the function in your calculated message.

                               

                              Either way, here are some instructions on how to create a calculated field:

                               

                              Go to File > Manage Database

                               

                              Make sure you are in the correct Table (not sure how many tables you currently have in your database...but a great way to ensure you are in the right table is if you see the other fields listed you're working with)

                               

                              At the bottom of the window, Type in the name of the New Field you'd like to create.

                              To the Right of that, you'll see a list which you can select the Field Type. Set that to Calculation.

                               

                              Then click CREATE

                               

                              upon creation, a Specify Calculation Window will open, allowing you to use the different related fields and functions available.  Also in that window, at the bottom, you can set the type of result the calculation is render:  Date, Number, Text, etc.

                               

                              (There are additoinal options you can choose as well with a calculation field.  this is just very generic instructions)

                               

                              Once you've specified your calculation, you can click OK on everything and you'll return to your database.

                               

                               

                               

                              If you want/need the new calculation field to appear in your layout(s),  Enter Layout Mode and place the new field into your your layout.

                               

                              That should cover it.