putyourlightson / craft-campaign

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

Checkbox ticks not showing in contact, but are working in the background #497

Closed michelledewit closed 1 month ago

michelledewit commented 1 month ago

Bug Report

Hi,

For campaign we added a custom field to segment contacts. In the registration process the user can choose various options via checkboxes to sign-up for a specific newsletter. In the contact list in Craft CMS after adding this feature the new contacts are visible with their chosen option, so that's great.

For old contacts that already where there before the new custom field, they were manually given the correct segment for the custom field in a csv file. We imported this file with the correct segments and after that the checked checkboxes were visible in the view of a contact person. But after a few days the checked checkboxes were invisible, so we tested if the segments weren't seperated anymore but this was still working. For example If you delete a contact from a segment it is correctly working cause it removes the contact from the segment and vice versa. So it is still working but it isn't showing the checkbox ticks. This creates a lot of confusion for our customer, because for more than 1000 contacts it is not visible within segment the contact belongs.

Thanks in advance!

Plugin Version

1.26.0

Craft CMS Version

3.9.13

PHP Version

No response

bencroker commented 1 month ago

I'm not entirely following. When you say Segments, do you mean Mailing Lists? Maybe a few screenshots (or a video) would help me understand the issue and how I can replicate it locally in order to troubleshoot.

michelledewit commented 1 month ago

Hi,

On the front-end the website user sees this form:

Schermafbeelding 2024-09-25 om 10 08 50

When the user has checked a checkbox and is registered, it becomes a contact with the correct checkbox checked:

Schermafbeelding 2024-09-25 om 10 10 07

The 2 checkbox options are segments:

Schermafbeelding 2024-09-25 om 10 18 18 Schermafbeelding 2024-09-25 om 10 18 02

And for new contacts the above thing works fine, but for old contacts who are manually given a checkbox preference. The checkbox isn't showing, like this:

Schermafbeelding 2024-09-25 om 10 24 56

But the thing is, the contact still belongs to a segment (which is good) but it isn't visible in the contact profile anymore. The correct checkbox was visible when we imported the file with the correct segments but after a few days the visible checkbox disappeared in the contact view.

bencroker commented 1 month ago

For old contacts that already where there before the new custom field, they were manually given the correct segment for the custom field in a csv file.

Those checkboxes are a custom field on the contact, so not connected to the segment at all. And as far as I’m aware, there’s no way to attach a segment to a contact on import. So I’m confused as to what action you took that would have caused the checkbox to be checked for old contacts?

michelledewit commented 1 month ago

The segment is connected to the custom field "newsletterList" (which are the checkboxes). So the segment condition is like this: If a contact contains {{newsletterList}} then put the contact in this segment.

The old contacts were given the correct checkbox in a .csv file and after importing this file, the correct checked checkbox were showing in the contact profile in Craft Campaign. But after a few days this checked checkbox disappeared but they are still working in the background. So the old contacts are still in the correct segment but it isn't visible through the checkboxes

bencroker commented 1 month ago

Very strange. Were the checkbox values changed at any point? If you look in the database, can you identify the field values that the contacts in question have?

michelledewit commented 1 month ago

I've found a bunch of rows in the content table which have my field values:

image

I'm just not sure how to see which Campaign contact corresponds to one of these rows. Any idea? Basically, if I'm viewing a contact in the Campaign UI I need to figure out how the id of the contact corresponds to a row in the content table, so I can see the field value of that contact.

bencroker commented 1 month ago

The contact ID is the same as the element ID, which should exist in the content table.

michelledewit commented 1 month ago

Hi Ben,

Thanks for helping, we've found the problem! It was an error in .csv what wasn't a problem for the database but it was for the control panel.

bencroker commented 1 month ago

Glad to hear you figured it out!