Created this package on my free time to improve developer experience using Laravel/E-goi
I´m not affilied to E-goi
You can install the package via composer:
composer require bernardinosousa/egoi-laravel
You can publish the config file with:
php artisan vendor:publish --tag="egoi-laravel-config"
Add to .env file:
EGOI_API_KEY="YOUR_API_KEY"
use Bernardinosousa\EgoiLaravel\Facades\EgoiLaravel;
//Get All Contacts from List
try {
$listId = 1;
$contactListResponse = EgoiLaravel::api('contacts')->getAllContacts(
$listId
);
dump($contactResponse);
} catch (\Exception $e) {
dump('Exception when getting all contacts from list: ', $e->getMessage());
}
//Get Contact Information from List Id and Contact Id
try {
$listId = 1;
$contactId = "f51f0117ba";
$contactResponse = EgoiLaravel::api('contacts')->getContact(
$contactId,
$listId
);
dump($contactResponse);
} catch (\Exception $e) {
dump('Exception when getting contact information: ', $e->getMessage());
}
//Create Contact from List
try {
$contactBaseExtraPost = new \EgoiClient\EgoiModel\ContactBaseExtraPost([
'base' => [
"status" => "active",
"first_name" => "John",
"last_name" => "Doe",
"birth_date" => "1975-01-10",
"language" => "en",
"email" => "[email protected]",
//"cellphone" => "351-300404336",
//"phone" => "351-300404336",
"push_token_android" => [],
"push_token_ios" => []
]
]);
$listId = 1;
$contactResponse = EgoiLaravel::api('contacts')->createContact(
$listId,
$contactBaseExtraPost
);
dump($contactResponse);
} catch (\Exception $e) {
dump('Exception when creating contact from list: ', $e->getMessage());
}
If you would like to have more examples, see E-goi sdk-php endpoints
- AdvancedReportsApi
- AutomationsApi
- CNamesApi
- CampaignGroupsApi
- CampaignsApi
- ConnectedSitesApi
- EcommerceApi
- EcommerceActivityApi
- EmailApi
- FieldsApi
- ListsApi
- MyAccountApi
- OperationsApi
- PingApi
- PushApi
- ReportsApi
- SegmentsApi
- SendersApi
- SmartSmsApi
- SmsApi
- SuppressionListApi
- TagsApi
- TrackEngageApi
- UsersApi
- UtilitiesApi
- VoiceApi
- WebHooksApi
- WebpushApi
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.