Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import contacts with DoNotContact set to TRUE #9027

Closed
ericjohncarlson opened this issue Jul 22, 2020 · 13 comments · Fixed by #9186
Closed

Unable to import contacts with DoNotContact set to TRUE #9027

ericjohncarlson opened this issue Jul 22, 2020 · 13 comments · Fixed by #9186
Labels
bug Issues or PR's relating to bugs import-export Anything related to importing and exporting ready-to-test PR's that are ready to test T1 Low difficulty to fix (issue) or test (PR)
Milestone

Comments

@ericjohncarlson
Copy link

Bug Description

Creating a simple CSV with two columns, email and donotContact. Select the csv file, map email to email, map donotContact to Properties Do Not contact. Import correctly imports the contacts, but the imported rows are not marked for do not contact.

Q A
Mautic version 3.0.1
PHP version 7.2.32
Browser Chrome

Steps to reproduce

  1. Create .csv with two columns, email and donotContact
  2. Enter email addresses. Set donoContact to "TRUE" "yes" or "1"
  3. Run the import process.
  4. View imported contacts, not that they are not marked as do not Contact

Log errors

None.

Theory

I see that donotContact information is stored in a different table (lead_donotcontact). Now with a reason code, do not contact type, etc. I'm not sure if this import process is legacy from 2.x where that flag was on the lead table and now it's a separate table? Seems like there needs to be a mapping or a process job to mark these contacts as donotcontact?

Any other work arounds other than manually setting these?

@ericjohncarlson ericjohncarlson added the needs-triage For new issues/PRs that need to be triaged label Jul 22, 2020
@ericjohncarlson
Copy link
Author

I quickly stood up a new mautic 2.16.3 instance and tried the same import process with the same incoming .csv file and these contacts were successfully imported and marked as do not contact. I think this defect is only in the 3.x branch.

@janus-reith
Copy link

janus-reith commented Jul 23, 2020

Besides TRUE I tried true and 1and I can confirm this doesn't work.
Also, it applies both to browser and background importing.
I just tried exporting contacts with doNotContact set, the field is also missing from exports.

@RCheesley RCheesley added import-export Anything related to importing and exporting bug Issues or PR's relating to bugs T1 Low difficulty to fix (issue) or test (PR) labels Jul 24, 2020
@RCheesley
Copy link
Sponsor Member

Anyone have any errors from the logs in /var/logs ?

@RCheesley
Copy link
Sponsor Member

(Also if you can share the file that worked in 2.x that would be super helpful!)

@janus-reith
Copy link

@RCheesley This would be a most basic example of comma separated values where it fails, although I didn't test in 2.x:

email,doNotEmail
5o9_56e20cmz3png@byom.de,true
5w5_2cakhl38al0o@byom.de,false

or just

email,doNotEmail
5o9_56e20cmz3png@byom.de,true

Both fields will be matched right away, but I double-checked that in the UI and also tried with other field names which I consequently had to match in the UI next.
Import succeedes and both contacts are created, doNotEmail / doNotContact however is not set.
The log for that day contains no new lines after the import.

@RCheesley
Copy link
Sponsor Member

Great, thanks for the detail! I found a previous PR here that mentions using 0 or No or False for the field.

Tested and indeed, it does not seem to be working.

Here is the file that I used:
check-dnc-import.csv.zip.

@RCheesley RCheesley added mautic-3 and removed needs-triage For new issues/PRs that need to be triaged labels Jul 30, 2020
@mautibot
Copy link

mautibot commented Aug 2, 2020

This issue has been mentioned on Mautic Community Forums. There might be relevant details there:

https://forum.mautic.org/t/confusion-with-interface-blacklisted-vs-not-blacklisted-with-toggle-details/15475/3

@mautibot
Copy link

This issue has been mentioned on Mautic Community Forums. There might be relevant details there:

https://forum.mautic.org/t/cannot-bulk-import-do-not-contact/16027/2

@npracht
Copy link
Member

npracht commented Sep 11, 2020

Hi there, can you please test #9186 ?

@npracht npracht added ready-to-test PR's that are ready to test and removed mautic-3 labels Sep 11, 2020
@jacobshilitz
Copy link
Contributor

even with my PR #9186 I still found that it only fix when you update a contact, but if you set doNotEmail on a new contact it does not add it.

the bug is that it tries to add DNC before the lead even exists, but the DNC is stored in a separate table so the lead has to be saved first, then you can add its ID in the DNC table.

@dennisameling
Copy link
Member

dennisameling commented Sep 20, 2020

@jacobshilitz I'll try to come up with a separate PR which has a fix for this exact issue, as it's also impacting contacts created through the API. This is currently blocking us from releasing Mautic's API library v3 as this is the very last automated test that's failing: https://travis-ci.org/github/mautic/api-library/jobs/728564625

UPDATE: PR done: #9229

image

@dennisameling
Copy link
Member

Hi! To keep things central regarding issues around Do Not Contact (DNC), I created a JIRA issue to track all issues related to DNC in a single place. That way, we can more efficiently fix the several bugs that were reported. Please check it out: https://mautic.atlassian.net/browse/TPROD-72

@RCheesley RCheesley modified the milestones: 3.1.1, 3.1.2 Sep 21, 2020
@npracht
Copy link
Member

npracht commented Oct 16, 2020

Fixed in 3.1.2

@npracht npracht closed this as completed Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs import-export Anything related to importing and exporting ready-to-test PR's that are ready to test T1 Low difficulty to fix (issue) or test (PR)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants