1 2 Previous Next 15 Replies Latest reply on Apr 15, 2011 6:18 AM by Quarterly

    Creating an email template - is it possible?

    Quarterly

      Title

      Creating an email template - is it possible?

      Post

      I'm working with FM11. I've got a few template letters in my database which are simple, easy to use and print perfectly. Now I need to learn how to send them by email. 

      I know how to use the email function, and it works, what I can't figure out is how to insert my template into the body of the email. Is it possible? I've read several posts, however, those generally say the person in need of help already knows how to insert their letter into the body, so I feel like I've missed an explanation somewhere. I have read the tutorial and I have The Missing Manual at my fingertips. Inserting text from a file is proving to be useless. 

      If all else fails, is it possible to copy and paste or export my letter with the merge fields filled in to MS Word? So far I've had no luck. I'm about to resort to using an email template and filling in all of the blanks myself, which is will take up quite a bit of time. I really feel as though I'm missing the obvious. 

      If anyone could steer me in a helpful direction, even a link to an answer to this question already posted that I've missed, I would be truly grateful. 

        • 1. Re: Creating an email template - is it possible?
          philmodjunk

          Key question: Do you want to reproduce a layout from your database inside the body of the email? That can't be done in plain FileMaker, but there are email plug ins that may be able to do this.

          If a plain text email will do the job, then you can certainly set up "templates" where static text from the template is combined with data from other fields to create the message in the email body.

          Using a Merge option with Export Records, you can also export data for import into MS Word for what you described at the end. I haven't done that in years and there may now be an option where you don't even have to export the data, but it should be possible to do.

          Here's an example of how you might set up some plain text email templates. I think the Email campaign management starter solution does something similar:

          Define a table of email templates. You can use just three fields for this:

          TemplateID (serial number)
          TemplateName
          TemplateText

          Here's one simple template just to give you the basic idea. Type this text into the TemplateText field:

          Dear <salutation>,

          Crongratulations on your purchase of a new <productname>!

          Relate your email table to this template table by TemplateID and set up a value list so that you can select a given template record. Now you can use this expression for the body of the email. (Click the arrow next to the Body box and choose the calculation option.):

          Substitute ( TemplateTable::TemplateText ; ["<salutation>" ; Yourtable::Salutationfield ]; ["<productname>" ; YourTable::productNamefield] )

          • 2. Re: Creating an email template - is it possible?
            Quarterly

            Thank you for your help. 

            "If a plain text email will do the job, then you can certainly set up "templates" where static text from the template is combined with data from other fields to create the message in the email body."

             Perfect, exactly what I want.

            "Define a table of email templates. You can use just three tables for this:"

            Did you mean three fields, not tables? 

            Fast forward to sending the emails, assuming I can figure this out tomorrow. When I'm given options after clicking "Mail," When I get to Message, and I click on the arrow to select what to insert, what will I choose? Field? I'm running out of time in my workday today so I'm trying to think ahead for when I get in tomorrow morning. 

            If all else fails I can export the information I need in the letters to Excel and create a mail merge document in Word to copy and paste into email, but if Filemaker can help me skip a bunch of steps, I'm in. 

            • 3. Re: Creating an email template - is it possible?
              Quarterly

              It sounds like the person you helped here had the same question I do: 

              http://forums.filemaker.com/posts/78dbe2f6c0

              I will take a close look at that tomorrow. 

              • 4. Re: Creating an email template - is it possible?
                philmodjunk

                Yes fields, not tables. I edited my previous post to correct that.

                You can either click that arrow button and use the calcuation option, or you can set up the substitution calculation in a calculation field and use the field option to refer to the calculation field. The email produced is the same, but having a calculation field you can examine may be useful when you set up some template records and need to check them to make sure that they are correct.

                • 5. Re: Creating an email template - is it possible?
                  Quarterly

                  I'm starting to get there. How should I make the templateID relate to the email table? 

                  And I'm a bit lost on the calculations part, but I'm hoping that when I'm ready for that my Missing Manual will be there for me. I was so excited to finally have everything working the way I wanted to and then snagged on the email part. Thank you so much for your help. 

                  • 6. Re: Creating an email template - is it possible?
                    philmodjunk

                    TemplateID should be defined as an auto-entered serial number in the Template table.

                    • 7. Re: Creating an email template - is it possible?
                      Quarterly

                      I did that, but how do I relate the templateID in the template table to the email table?

                      • 8. Re: Creating an email template - is it possible?
                        philmodjunk

                        In Manage | Database | Fields

                        1. Define a TemplateID number field in your email table
                        2. Click the relationships tab
                        3. Drag from TemplateID in the box for one table to the TemplateID field in the other.
                        • 9. Re: Creating an email template - is it possible?
                          Quarterly

                          Well now I feel rather proud of myself because I already did that. 

                          Ok, I'll have to play around with the rest of it for a bit while working on more pressing matters in the office. I'll probably come back with more, but I just wanted to say thank you. 

                          • 10. Re: Creating an email template - is it possible?
                            Quarterly

                            "Relate your email table to this template table by TemplateID"

                             I realize that I neglected to mention that I want to use field information from 2 different tables. I have Entries and then I have Entry History that are linked through a portal. I want the email letters to have merge fields for the first and last name, found on Entries, and for the names of the products, found on Entry History. (the tables aren't really called that, but the actual names are probably going to cause confusion because they relate strictly to my needs of the database).

                             So now I've got this third table for the email letter templates. How much does this new information muck up your previous instructions? I'm going in circles. I can't even figure out how to send an email template through the Email Campaign starter solution. I can send emails, but they're blank.

                            • 11. Re: Creating an email template - is it possible?
                              philmodjunk

                              What information from the related table do you need to include in the email?

                              If you just need to refer to data in the first related record in Entry History, you can just refer directly to those fields; EntryHistory::field

                              If you want to refer to the last record in the Entry History, you can use the last function: Last ( entryHistory::Field )

                              If you want data from one field from all the related records, use the list function: List ( EntryHistory::Field ). This produces a list of text with the data from each record separated by a return. If you want a list separated by commas or other text, you can use this expression:

                              Substitute ( List ( EntryHistory::Field ) ; ¶ ; ", " )

                              To check to see if your email software is correctly working with FileMaker, try using Send Mail from the file menu to send a simple email to yourself. If you can get that to work, then the blank email you are getting is due to issues with how you are using the starter solution. If you can't get it to work then you'll need to research your specific email software to see if it is compatible with FileMaker and if it is configured correctly.

                              • 12. Re: Creating an email template - is it possible?
                                Quarterly

                                I can type a note in the FM Mail message part and that goes through fine, and I can insert a field and that goes out fine. If I try to do a combo of an inserted field and a note I typed, problem but that's to do with me not knowing how to format that so the program isn't looking for a field that doesn't exist (I'll do some more research there). Basically, the email works. It's me!

                                First name and last name are from the first table I made, product names are from the related table. The email I would be sending to is also on the original (parent?) table, but that part already works fine. Basically I just need to insert 3 fields and a template letter. Ideally I would like to have a few different letters I could use, depending on the need. It sounds so simple, but it's so not. It would look something like: 

                                 Dear First Name Last Name, 

                                 Thank you for your suggestions. However, we will not be using them at this time. 

                                Sincerely, 

                                Me

                                Product Names:

                                insert product names

                                • 13. Re: Creating an email template - is it possible?
                                  philmodjunk

                                  Changing that into a template in your template text field might look like this:

                                  Dear <First Name> <Last Name>, 

                                   Thank you for your suggestions. However, we will not be using them at this time. 

                                  Sincerely, 

                                  Me

                                  Product Names:

                                  <ProductList>

                                  The calculation you could use for the email might look like this:

                                  Substitute ( TemplateTable::TemplateField ; ["<First Name>" ; Entry::FirstName] ; ["<Last Name>" ; Entry::LastName ] ; ["<ProductList>" ; List ( EntryHistory::ProductName ) ] )

                                  • 14. Re: Creating an email template - is it possible?
                                    Quarterly

                                    It makes sense when I look at it, we'll see how I translate it. Although that will have to wait for tomorrow, or Monday. 

                                    Thank you so very much, you have no idea how much hope you've given me.

                                    1 2 Previous Next