I want to know how I can use a Netlify function to add a subscriber (Name and Email) to my marketing automation software (Aweber, Activecampaign, Infusionsoft etc) and I can find nothing online that will show me how to do this. I have found a number of links that show you how to send an email but not add a name and email to a list. I am not a back end guy (barely know what I am doing on the front end) which is why I am looking at Netlify and the Netlify CMS. I am stuck in Wordpress Hell and looking for a way out but cannot move on without being able to add contacts to numerous marketing automation platforms via cloud functions etc. I clearly want to avoid using a signup form provided by the marketing automation platform and go wit creating my own form. Likewise - I do not want to be limited using a tool like Zapier (I don’t want to pay for Zapier).
For the life of me I cannot figure out why this information isn’t easy to find. I would think this is something large numbers of people would want to do and that someone/ somewhere would have something on this already.
You can use Netlify Forms and connect via api through Zapier, Integromat, Intergrately or Pabbly Connect…to just about any email marketing software (as well as many other applications). Hope that helps
Also…most email marketing applications have their own embedded forms. You should be able to drop one in and overwrite the css to match your styles (a little work but can be done).
Creating a cloud function to do something like this may prove to be fairly complex (particularly if you are using a app that requires O’Auth as opposed to api keys etc).
Part of the issues is storing and updating auth tokens…which would require a database etc.
The fastest and easiest approach would be to use the method provided in my first reply. Use a third party to connect your two apps.
@JohnnyK, if the above doesn’t work for you, or if you need to connect using Netlify Functions itself, do let us know and we can try to work out a solution for you and others who might have this question.
We are fairly committed to ActiveCampaign at this point.
And I would like to avoid paying for a third party integrator such as Zapier.
Their API uses an account secret for authorization and I’m able to obtain conduct GET requests but am having trouble adding new clients through a POST.
Their example uses php, and I’m just using axios to GET/POST.
@hrishikesh I would eat a bug and do a happy dance if your team could show me an example of how to add a contact to a list. It would probably take you 5 minutes.
The above documentation is v1. ActiveCampaign have a RESTful version 3 API which uses different information in the POST body, including firstName instead of first_name.
This is only a best guess based on reading—I don’t have and AC account to test with.
Looking at the documentations, yes the above examples seem to be correct, but if it’s still not working, we’d need an account to test. They don’t seem to have a free plan sadly.
I wanted to make sure to close this and share my answer.
Thanks so much to @reza jafari for his comment in this post on StackOverflow where he brought to my attention the code window on the right margin of Postman where you can choose the language/server from a dropdown and it provides the correctly formatted response.
I was able to get my post working in Postman, and this little trick squared me away. I’ll go ahead and post my solution to close this post.