Handling multiple checkbox values with the same name in gform_after_submission

I am using gform_after_submission to post data from my form to a 3rd party site. The data has to be passed in a specific format for checkboxes and I am having trouble figuring out how to pass the field values in this format.

There are groups of checkboxes, with each group of inputs sharing the same name, and when I post data directly through the 3rd party’s form the payload looks like this:

OPTIONS: newsletter
OPTIONS: updates
OPTIONS: general

In my gform_after_submission action I tried setting it up like this:

$body = array(
    'OPTIONS' => rgar( $entry, '11.1' ),
    'OPTIONS' => rgar( $entry, '11.2' ),
    'OPTIONS' => rgar( $entry, '11.3' ),
);

But that doesn’t seem to work. Any ideas how I can pass these checkbox values in the format required?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.