Closed robmies1968 closed 6 months ago
Indeed there is no documentation. Eventually there will be, but RainLoop never did and i need to find time somewhere.
To add a contact look at https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php#L92 There you see that it:
So you need:
$oActions->AddressBookProvider($oAccount);
$vCard = new \Sabre\VObject\Component\VCard;
$oContact = new \RainLoop\Providers\AddressBook\Classes\Contact();
$oContact->setVCard($vCard);
$oAddressBookProvider->ContactSave($oContact);
There is at least some first try to write a developer documentation https://github.com/the-djmaze/snappymail/wiki/Developer-Documentation I know, this is not directly that what you're looking for, but maybe it helps you a bit. If you have made some progress on your project maybe you find some time to add your knowledge to this first document 🙂
Thanks! I will add examples of found knowledge to this document. And I will look further into teh developer documentation.
That would be great! Had exactly the same problems when I've written my plugin, so I know it is a bit hard to begin 👍
Is your feature request related to a problem? Please describe. I am looking for some API examples
Describe the solution you'd like A simple, or a few examples.
Describe alternatives you've considered Not using the API, but programming 'around' Snappymail.
Additional context Here I have an example of me trying to get the number of all read and unread emails from a logged in user:
I don't know if this is the best way of doing it, but it works. Problem is, I was really struggling to come up with this piece of code. Is there some kind of documentation (without me first reverse engineering the codebase) of the API? If somebody has an example of how to create a contact, for instance, that would help a lot, because I think that is quite a difficult procedure. I have tried:
$oActions->DoContacts()->AddContact($email, $email, $email);
, but that fails. :(