Using OpenAI in FileMaker applications to assist in writing e-mails

Look at the Youtube video we have just uploaded:

Look in the download section to download the demo application shown in the video.

You can have OpenAI assist you in Writing an email to a customer. To improve the AI’s result, it is important to have some background information available to produce the desired result more precisely. We look at two services at OpenAI.

  • The Chat service
  • The Completion service

The chat service can have a complete dialogue going on, while the Completion service is more of a one-shot prompt-and-answer type of service with no background information.

Using the chat service, you can supply background information in the chat thread, pulling data from your database and put into the thread as background information:

  • Role System: You are a professional copywriter specializing in crafting compelling offer emails.
  • Role User: Here is an abstract about Product X: ‘Product X is a state-of-the-art widget that improves productivity by 50% in manufacturing workflows. (Abstract on the product record in the database)
  • Role User: Here is an abstract about Product Y: ‘Product Y is a versatile tool designed for small businesses, offering advanced analytics and ease of use. (Abstract on the product record in the database)
  • Role User: Customer context: ‘The customer is a medium-sized manufacturing company looking to modernise their operations and adopt cost-effective solutions. (Abstract found on the prospect record in your CRM system)
  • Final message, role User: Can you help me write an offer email to this customer highlighting the benefits of Products X and Y? (User input in the CRM e-mail assistant layout)

The final output of this thread could be:

Dear [Customer Name],

We are thrilled to introduce you to two solutions that could revolutionize your manufacturing operations. Product X boosts productivity by 50%, helping streamline your workflows and cut down on inefficiencies. Meanwhile, Product Y offers powerful analytics and unparalleled ease of use, tailored for businesses like yours.

Together, these tools can modernize your processes and deliver cost-effective results, empowering your company to stay ahead in the competitive market.

We’d love to discuss how these products can meet your specific needs. Let’s schedule a quick call or demo at your convenience.

Best regards, [Your Name] [Your Position] [Your Company]

This way, we can harvest all the necessary info from our database to help OpenAI produce the best possible text for our e-mail to the customer. In preparation for this, we could also use OpenAI to help produce abstracts for the product descriptions. The source could be a product sheet PDF or website content. For a few products, manual work on the chatGPT web interface is feasible. For a larger product database, we have some references to the documentation available and linked to the products; we could automate the abstract generation using the OpenAI endpoint to complete one abstract at a time.

Implementing this into the CRM system

The natural next step would be to have this functionality built into the CRM system. An integrated E-mail client using chatGPT as an assistant to help write better emails faster. We have done an example of this shown in the ACF-library section.

Security concerns

It would be important not to have any identifying information sent to the AI service, We would therefore use a placeholder technique to instruct the chat endpoint to use those placeholders in the e-mail, and then we can replace it in the text after. Such placeholders would be:

  • [Customer Name]
  • [My Name]
  • [MyCompany]
  • etc

About the Demo application

I put together all this into the CRM for a demo. The demo consists of the following FileMaker tables.

  • Preferences ( holding the OpenAI API key)
  • Email_accounts ( Holding the server login, signatures, and other related data)
  • Email_messages (The email composer table, holding all necessary e-mail fields, and also chat endpoint fields. )
  • Definitions ( containing keywords and abstracts ) for use to build context for chat endpoints.
  • Attachements ( for any attachement to the e-mail )

I included the ACF developer package in the app, and installed the ACF packages needed for the demo to work. You can see the source code for it on the ACF-library page.

I copied into the table “Defenitons”, keyword ACF-plugin, and some descriptive text.

I started a new e-mail, selected the ChatGPT tab, and asked:”Can you write an email to a customer regarding the @ACF-Plugin and propose a demo”

The result that came up (Copied into Typora, my favourite MarkDown editor):

Hi Ole,

I hope you are doing well! I wanted to reach out regarding the ACF Plugin, which is tailored for developers and in-house development teams looking to enhance their Claris FileMaker solutions with advanced functionality.

To give you a better understanding of what the ACF Plugin can offer, I would like to offer you a demo. This will allow you to see the powerful programming capabilities, extensive functionality, and seamless integration in action.

Here are some of the key features:

  • Powerful Programming Capabilities: Streamline development with the ACF Plugin’s structured programming language.
  • Extensive Functionality: Access SQL, MySQL, JSON/XML data handling, array manipulation, and file management functions.
  • Seamless Integration: Effortlessly integrate FileMaker variables, fields, and built-in/custom functions.
  • Compiler and Runtime System: Transform your source code into binary formats for efficient execution.

I look forward to hearing from you so we can schedule a time for the demo.

Here is a link for more information about the ACF Plugin: ACF Plugin for FileMaker

The JSON Request looks like this (Here, we see that the functions have composed the request and included details about the plugin referenced in my request without the need for me to supply any other details.

{
  "messages": [
      {
          "content": "You are a professional copywriter crafting emails. \n\nUse placeholder ++name++ for the recipient name in the start. Exclude any closing statements or sign-offs. \nWrap the email content in <email> tags and comments in <comments> tags. Use Markdown for formatting.",
          "role": "system"
      },
      {
          "content": "Description af ACF-Plugin: The Developer License for the ACF Plugin is tailored for developers and in-house development teams seeking to enhance their Claris FileMaker solutions with advanced functionality. Designed for internal use, this license is ideal for building and testing custom features without wide-scale deployment, which is covered under the separate Runtime License.\r\rKey Features:\r\rPowerful Programming Capabilities: Leverage the ACF Plugin’s structured programming language to streamline development within FileMaker.\rExtensive Functionality: Access SQL, MySQL, JSON/XML data handling, array manipulation, and file management functions directly within your solutions.\rSeamless Integration: Effortlessly integrate FileMaker variables, fields, and built-in/custom functions, simplifying your workflows.\rCompiler and Runtime System: Transform your source code into binary formats for efficient execution.\rThis license empowers developers to innovate and test efficiently while ensuring a dedicated deployment solution through the Runtime License.\r\rLink: https://horneks.no/produkt/acf-plugin-for-filemaker",
          "role": "user"
      },
      {
          "content": "Can you write an email to a customer regarding the ACF-Plugin and propose a demo",
          "role": "user"
      },
      {
          "content": "<email>\nHi ++name++,\n\nI hope you are doing well! I wanted to reach out regarding the ACF Plugin, which is tailored for developers and in-house development teams looking to enhance their Claris FileMaker solutions with advanced functionality.\n\nTo give you a better understanding of what the ACF Plugin can offer, I would like to offer you a demo. This will allow you to see the powerful programming capabilities, extensive functionality, and seamless integration in action.\n\nHere are some of the key features:\n\n- **Powerful Programming Capabilities**: Streamline development with the ACF Plugin’s structured programming language.\n- **Extensive Functionality**: Access SQL, MySQL, JSON/XML data handling, array manipulation, and file management functions.\n- **Seamless Integration**: Effortlessly integrate FileMaker variables, fields, and built-in/custom functions.\n- **Compiler and Runtime System**: Transform your source code into binary formats for efficient execution.\n\nI look forward to hearing from you so we can schedule a time for the demo.\n\nHere is a link for more information about the ACF Plugin: [ACF Plugin for FileMaker](https://horneks.no/produkt/acf-plugin-for-filemaker)\n\n</email>",
          "refusal": null,
          "role": "assistant"
      }
  ]
}

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *