linkage / sendgrid-marketing-campaign-api-client
用于Sendgrid营销活动API的简单PHP客户端
v1.2.0
2024-08-19 01:51 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- symfony/property-access: *
- symfony/serializer: *
Requires (Dev)
- phpunit/phpunit: ^10.4
- quartetcom/static-analysis-kit: 8.2.x-dev
This package is auto-updated.
Last update: 2024-09-19 01:57:15 UTC
README
安装
composer require linkage/sendgrid-marketing-campaign-api-client
使用
$apiKey = 'get your api key from sendgrid admin screen'; $sendgridClient = new \Linkage\SendgridMarketingCampaignApiClient\Client( new \Linkage\SendgridMarketingCampaignApiClient\SendgridApiRequester($apiKey), ); try { $sendgridClient->createContactList( new \Linkage\SendgridMarketingCampaignApiClient\ContactList\CreateContactListRequest('my new contact list'), ); } catch (\Linkage\SendgridMarketingCampaignApiClient\SendgridApiClientException $e) { // handle client error } catch (\Linkage\SendgridMarketingCampaignApiClient\SendgridApiServerException $e) { // handle server error }