Subscriber Plugin - Foreign Key problem with CSV import

I’m using phpList 3.3.3 with the Subscribers Plugin version 2.17.0+20180528 with Common Plugin version 3.7.18+20180528.

First of all, GREAT PLUGIN! The CSV import from the command line seems to be working fine for everything except for importing a foreign key. I’m using a CSV file that has the following layout:

username,displayname,email,foreignkey,attrib1,attrib2
atest,A Test,test@example.com,101,blue,25

If I import the CSV manually using the web GUI, everything imports into the correct fields including the Foreign Key field.
If I import using the plugin command, then the foreign key is not imported and the Foreign Key field is blank in the GUI.

Based on this thread:

I also tried using: ,foreign key, in the header line. It still did not import. (Tried ,Foreign Key, as well.)

The command I’m using is:
/opt/php-5.6.30/bin/php /var/www/clients/client5/web19/web/lists/admin/index.php -m SubscribersPlugin -p import2 -c /var/www/clients/client5/web19/web/lists/config/config.php -l 1 -f /csv4import/test-users.csv

Does anyone have any ideas of what I’ve done wrong?

@bhotrock You haven’t done anything wrong, it is just that the plugin does not support importing a foreign key. It supports importing only user attributes and the email address.

I will have a look to see whether that can be added.

@duncanc Thanks so much for the quick response. It’s good to know it’s not just me. :slight_smile:
If it’s possible to add the foreign key, that would be great!

@bhotrock I have made a change to support foreign key. It is a different branch in Github that you can install on the Manage Plugins page using the URL

https://github.com/bramley/phplist-plugin-subscribers/archive/foreignkey.zip

The column in the import file must be named “foreignkey”. The changes appear to work for me, but let me know if you have any problems.

@duncanc THAT’S AWESOME! It works just fine for me. Thank you so much!

@bhotrock Thanks. I have now made a new release of the main branch which you can install using

https://github.com/bramley/phplist-plugin-subscribers/archive/master.zip