How to Post Contact Form 7 data to any API with Simple API integration | Làm thế nào để send email đồng thời gửi qua API trong Wordpress

Bài viết này là mình tham khảo và sau đó có làm theo, kết quả thành công.
Các bạn có thể tham khảo bài viết dưới đây để thực hiện gửi API từ contact form trong Wordpress nhé.

Mô tả yêu cầu của mình:
Mình có contact form, KH vào và gửi yêu cầu, khi nhấn nút Submit thì thông báo thành công trên màn hình, đồng thời gửi nội dung trên form contact tới một API, mà trong API đó mình đã tích hợp việc lưu trữ dữ liệu KH, các việc khác như gửi email phản hồi cho KH biết đã gửi thành công, rồi email gửi về cho quản lý website biết thông tin yêu cầu của KH,...
Thật ra trong Wordpress cũng có thể làm được các yêu cầu trên, nhưng mình muốn tích hợp với API để thêm trải nghiệm.

Đây là bài viết gốc:

Hard to use Contact form 7 rest API? Let’s Understand API integration

Are you trying to use Contact form 7 rest api? I will show you the process to send (GET or POST) form data to remote API’s (with API integration) such as Active Campaign, Zapier, Sockets and other remote API’s using POST/GET.  For this, you just require Contact Form 7 version 4.2.0 or later. It is supporting XML and JSON too.

Install the required plugin

First, you will have to install the required plugin. The plugin is not available in the WordPress repository. You can download the free plugin from this link: Contact form 7 TO API.

“Contact form 7 TO API” is an open source software and free to use.

Contact form 7 TO API can be installed by following these steps:

  • Download the plugin from the above link.
  • Go to Plugins section of your WordPress dashboard where you want to add the plugin and go to Add New
  • You will see an option to upload plugin. Upload the zip file downloaded from the provided link
  • After the plugin is uploaded and installed, click on Activate
  • After activating the plugin, go to the settings to configure the plugin

How to use Conact Form 7 to API Plugin?

  • Chose the form on which you want to use with API Integration
Simple API Integration
  • Type the URL of your API request and select the request type (Post/Get)
Simple API Integration
  • Map your form fields as required and save your changes
  • Now open the page where your contact form is showing and test it by filling in with correct information
  • Submit the form and your API request should be successful. You will receive a success message
  • Check the record in the connected application (API URL) for success

By this procedure, you can easily connect your contact form 7 data to almost any API. I have successfully tested this process with  Active Campaign APIZapier‘s ZAP connection, Sockets Connection using POST method. Our client wants to send his website contact form data to Active Campaign API automation. By this type of remote systems, you can save your precious time and money. This is simplest way to use Contact form 7 rest api via this plugin.

So start using this simple API Integration and enjoy the automation for free. You can comment here for any further clarifications or help of mine


End

==========================



Bài viết trên hướng dẫn Input type = Parameter Get/Post 

Nhưng mình sử dụng Input type = json




    Bạn có thể bấm vào Debug Log để xem thêm kết quả chi tiết hơn:




====================


Link tải API Intergration dự phòng: https://www.mediafire.com/file/56tuav4yw3lf99t/cf7-to-api.zip/file


Nguồn: https://www.dharmishi.com/blog/post-contact-form-7-cf7-data-to-any-api-with-simple-api-integration

Nhận xét

Bài đăng phổ biến từ blog này

Khôi phục phân vùng ổ cứng do ghost nhầm theo Hieuit.net

Cách sử dụng 2 phương thức [httppost] và [httpget] trong MVC theo https://dzungdt.wordpress.com

MVC định dạng tiền tệ vnđ - Format currency vnd in MVC