6 Replies Latest reply on May 31, 2017 1:28 AM by koenthielman

    Connect to Mailgun api




      I'm trying to connect to the mailgun.com api but seem to be having a lot of trouble. My preference is to do this using HTTPPOST via the Insert From URL script step, but I keep hitting a brick wall with the syntax. I just don't seem to be able to generate a URL it recognises, even when I revert to using BaseElements to create a custom header. I've also tried dabbling with the BBox plugin to generate code using curl or php.


      Documentation for the Mailgun API seems quite good and shows examples using curl, Ruby, Python, PHP, Java, C# and Go but I just keep hitting a brick wall.


      This is on a Mac running OSX 10.11.4 in FM 13 or 14.


      I chose Mailgun because the API is fairly simple and they are inexpensive - I looked at Amazon SES, but their API seems unnecessarily complicated.


      I can con connect directly using Terminal, but I don't have much success when calling that from within FileMaker. I also thought about using PHP, but would prefer not to have to run this on server (and find someone to write the php for me).


      Ultimately the goal is to send html emails, but at this stage I can't even send plain text emails.


      In summary: I have domains and API keys in mailgun. I have email addresses in FileMaker. I want to use the Mailgun API to send multiple (personalised emails). I want to get the result back in FileMaker. I'd rather not use a plugin. I'm desperate to get this working, so I'd consider using a shell script or PHP, but those are really not preferred options.


      Maybe I'm hoping for the impossible, or maybe I'm having a senior moment. I'd really appreciate it someone could walk me through this or can give me some pointers.


      Many thanks in advance.



        • 1. Re: Connect to Mailgun api



          Ask DonCollier - he has lots of stuff working with Mailgun




          • 2. Re: Connect to Mailgun api

            Thanks John, I will.

            • 3. Re: Connect to Mailgun api



              I've had some success with Sparkpost, thanks to Daniel Wood's invaluable sample file (thank you weetbicks), which works fine with styled text, but delivers my html as text whenever I try anything more adventurous.

              • 4. Re: Connect to Mailgun api

                Try this little example file that might give you a heads up with the syntax.  FileMaker and mailgun work well together.  We have clients sending tens of thousands of emails at a time.


                This one uses a public key but you will get the gist of it from it.   Direct mail me if you need more help

                1 of 1 people found this helpful
                • 5. Re: Connect to Mailgun api

                  With the release of FM 16, I would like to resurrect this post. I am hopeful with FM 16's cURL options, we can now use native FM functionality with MailGun or other providers rather than using plugins.  Until a few days ago, I had no problems with the 360Works plugin, but I upgraded to version 3.02 a few days ago... now it hangs on my server. Anyhow, if I can avoid a plugin, I'm happy to do so. 



                  Has anybody successfully used FM 16 cURL statements to send HTML formatted mails on MailGun?  I've got text emails to send, but anything more seems to either not send or send text only.  Formatting is obviously key, which I clearly am not getting correct. Any help would be greatly appreciated. 

                  • 6. Re: Connect to Mailgun api

                    I tried to use the new FM 16 cURL functions but I'm also struggling with formatting. The use of characters like ' and " don't come into Mailgun. Mailgun receives only 'Testing in the text=... example below.


                    And that's a bit difficult if I need to send this kind of data as Options for cURL in Insert from URL


                        -F from='Excited User <mailgun@YOUR_DOMAIN_NAME>' \

                        -F to=YOU@YOUR_DOMAIN_NAME \

                        -F to=bar@example.com \

                        -F subject='Hello' \

                        -F text='Testing some Mailgun awesomness!'


                    So... Any help would be greatly appreciated.