putyourlightson / craft-campaign

Send and manage email campaigns, contacts and mailing lists in Craft CMS.
https://putyourlightson.com/plugins/campaign
Other
63 stars 25 forks source link

Formie integration in Campaign: bug in Category fields #382

Closed webvader closed 1 year ago

webvader commented 1 year ago

We're using the Formie integration with Campaign. We've built a Formie form which is composed of 4 fields, three PlainTextfields (firstName, LastName, email) and one category field (Topics). The Category field is used to determine the topics the user is interested in which are Blog categories. We're using the categories to build segments in Campaign.

We then used the custom fields in a Contact model. So also two PlainText fields, since email is already present in the contact model and a categories field named Topics, linked to same categories.

To sync the Formie data to Campaign, we use the available integration in Formie. All single fields are synced without a hitch, but the category field always stays empty. After some digging we found that the Formie integration processes the Category field as a comma-seperated list of Category titles. Campaign then tries to set the fields via setFieldValues but since the categories are not an array of category id's those are not picked up by setFieldValues.

We expect the categories to be synced in Campaign. I've posted the same issue on Verbb's issue tracker. https://github.com/verbb/formie/issues/1423

The plugin and Craft version numbers: Craft CMS 4.4.9 Campaign 2.6.1 Formie 2.0.28

bencroker commented 1 year ago

This is almost certainly an issue on Formie’s side, so I’ll subscribe to the issue in its repo and respond there if my help is needed.