Hello world,
I want to import contacts into a user folder from a .csv-file via a Python script.
My problem is, that I can create the contact and set some attributes like email or email2, but I can’t set first_name or last_name. The traceback shows:
Traceback (most recent call last):
File "./kopano-adressen.py", line 67, in <module>
new = kopano.user('testuser').store.folder('Contacts').create_item(email='testuser@test.com', email2='testuser2@test.de', last_name='Python1')
File "/usr/lib/python3/dist-packages/kopano/folder.py", line 485, in create_item
setattr(item, key, val)
AttributeError: can't set attribute
This is the code from my script:
#!/usr/bin/python3
import kopano
server = kopano.Server()
new = kopano.user('testuser').store.folder('Contacts').create_item(email='testuser@test.com', email2='testuser2@test.de', last_name='Python1')
I have consulted the documentation but I guess I am not experienced enough in programming to solve this problem.