vielhuber / ewshelper
Manage exchange contacts with a breeze.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/vielhuber/ewshelper
Requires
- php: >=5.6
- php-ews/php-ews: >=1.0
- vielhuber/stringhelper: >=1.0
- vlucas/phpdotenv: >=1.0
README
ewshelper is a little wrapper around php-ews and helps you manage your exchange contacts via php.
it can handle very big lists also helps you normalize your contacts data.
installation
install once with composer:
composer require vielhuber/ewshelper
then add this to your files:
require __DIR__ . '/vendor/autoload.php'; use vielhuber\ewshelper\ewshelper; $ewshelper = new ewshelper('**host**', '**username**', '**password**');
usage
get all contacts
$ewshelper->getContacts();
get contact by id
$ewshelper->getContact('**id**');
normalize name and phones
$ewshelper->normalizeData();
remove duplicates
$ewshelper->removeDuplicates();
add a new contact
$ewshelper->addContact([ 'first_name' => 'Max', 'last_name' => 'Mustermann', 'company_name' => 'Musterfirma', 'emails' => ['max@mustermann.de'], 'phones' => ['private' => ['0123456789'], 'business' => ['9876543210']], 'url' => 'https://www.mustermann.de', 'categories' => ['test'] ]);
update a contact
$ewshelper->updateContact('**id**', [ 'first_name' => 'Max', 'last_name' => 'Mustermann', 'company_name' => 'Musterfirma', 'emails' => ['max@mustermann.de'], 'phones' => ['private' => ['0123456789'], 'business' => ['9876543210']], 'url' => 'https://www.mustermann.de', 'categories' => ['test'] ]);
remove a contact
$ewshelper->removeContact('**id**');
sync contacts
the following helper function gets all exchange contacts in category test,
deletes those that are not present in the provided array and creates those that don't exist yet in exchange.
$ewshelper->syncContacts('test', [ [ 'first_name' => 'Max', 'last_name' => 'Mustermann', 'company_name' => 'Musterfirma', 'emails' => ['max@mustermann.de'], 'phones' => ['private' => ['0123456789'], 'business' => ['9876543210']], 'url' => 'https://www.mustermann.de', 'categories' => ['test'] ], [ 'first_name' => 'Erika', 'last_name' => 'Mustermann', 'company_name' => 'Musterfirma', 'emails' => ['erika@mustermann.de'], 'phones' => ['private' => ['0123456789'], 'business' => ['9876543210']], 'url' => 'https://www.mustermann.de', 'categories' => ['test'] ] ]);
note on outlook
when deleting phone numbers or making a lot of changes to existing contacts,
it is recommended to use the function clear offline items.