0

So far...

  • I've created a simple form processor and tested that it works just fine for creating new contacts.
  • I've entered "/wp-json/civicrm/v3/rest" for the CiviCRM Path in the CiviCRM Contact Form 7 Settings. (Thanks for Demerit's suggestion below.)
  • I've checked "Enable CiviCRM processing" in the Contact Form 7 form, and set entity to FormProcessor and action to the name of my form processor.
  • I've also gone back to the CiviCRM Contact Form 7 Settings and entered the URL for my website, entered the API key for my contact (which has admin rights) and site key too, even though WordPress and CiviCRM are running on the same site. This hasn't made any difference, however.

Am I overlooking any steps needs to get Contact Form 7 working with a form processor?

enter image description here

5
  • 1
    I found it quite useful to use something like Pipedream to test setting up CF7 with CiviCRM. If you enter your Pipedream URL in there instead, you can inspect exactly what is being sent and see if maybe some of the field names are incorrect or something like that. You can also use API3 Explorer in CiviCRM with FormProcessor entity and your form processor as the Action to test with the same data on the CiviCRM end.
    – Lars SG
    Jan 19 at 17:07
  • Thank you. I think I've done what you suggested but so far I'm not spotting anything wrong. From Pipedream, URL = eos8g15zsp4037b.m.pipedream.net/wp-json/civicrm/v3/…, {"key":"XXX,"api_key":"YYY","json":"{\"first_name\":\"Rahman\",\"second_name\":\"Kahn\",\"email\":\"patrick@embracingage.org.uk\",\"version\":3,\"sequential\":1}"}.
    – gillenpj
    Jan 19 at 20:55
  • Whereas the output from CiviCRM API v3, Rest, is POST crm.embracingage.org.uk/wp-content/plugins/civicrm/civicrm/… entity = FormProcessor action = test json = {"sequential":1,"first_name":"Rahman","last_name":"Khan","email":"patrick@embracingage.org.uk"} api_key = FIXME_USER_KEY key = FIXME_SITE_KEY
    – gillenpj
    Jan 19 at 21:02
  • 1
    Looks like you have second_name in CF7 and last_name in CiviCRM.
    – Lars SG
    Jan 20 at 0:39
  • Thank you so much, Lars. Clearly, I'm an idiot. I did not spot that. Your diagnostic technique was the crucial step. I'll answer my own question below in case it's of any help to others.
    – gillenpj
    Jan 20 at 15:10

2 Answers 2

1

extern is pretty much deprecated but also wordpress has its own REST: https://docs.civicrm.org/dev/en/latest/api/v3/wp-rest/

1
  • Thanks for suggestion. I've changed the inputs in CiviCRM Contact Form 7 Settings as shown in screenshot now attached to main post. Unfortunately, I still don't seem to be able to connect Contact Form 7 to CiviCRM on WordPress.
    – gillenpj
    Jan 19 at 15:08
1

I eventually worked out to make this work, thanks to crucial advice from Demerit and Lars.

A set of CiviCRMs CF7 settings which worked for me is shown in the first diagram below. It may be that this also works by just filling in the CiviCRM Path if you're running WP and CiviCRM on the same site, however I've not tested that.

enter image description here

The CiviCRM tab of the CF7 form is shown in the second diagram below. You could put other stuff on the additional parameters line but nothing appears to be mandatory.

enter image description here

The CF7 form likes like the following:

enter image description here

And the form processor looks like the following:

enter image description here

Finally, I'd like to reiterate how helpful Lar's suggestion above was in tracking down the stupid mismatch between input field names I inadvertently introduced. Unfortunately, the form is silent in such cases and no contact is created.

Postscript. To expand on Lar's suggestion:

  1. Go to https://pipedream.com/ and sign up for free account.
  2. Create a new workflow and select HTTP Webhook as trigger with HTTP Requests. You will get a temporary URL that listens out for traffic. This is shown in diagram posted below.
  3. Now copy this URL into CF7 CiviCRM Settings replacing the URL of your own WP site.

Pipdream will show you exactly what the CF7 is transmitting, and help you track down mismatches between the form and form processor.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.