elasticemail/elasticemail-php
Composer 安装命令:
composer require elasticemail/elasticemail-php
包简介
The PHP library for the Elastic Email REST API. This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. To start using this API, you will need your Access Token. Remember to keep it safe.
README 文档
README
This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach.
Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used.
The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request.
To start using this API, you will need your Access Token (available here). Remember to keep it safe. Required access levels are listed in the given request’s description.
Downloadable library clients can be found in our Github repository here
Installation & Usage
Requirements
PHP 7.4 and later. Should also work with PHP 8.0.
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/elasticemail/elasticemail-php.git"
}
],
"require": {
"elasticemail/elasticemail-php": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/ElasticEmail/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: apikey $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer'); $apiInstance = new ElasticEmail\Api\CampaignsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $name = 'name_example'; // string | Name of Campaign to delete try { $apiInstance->campaignsByNameDelete($name); } catch (Exception $e) { echo 'Exception when calling CampaignsApi->campaignsByNameDelete: ', $e->getMessage(), PHP_EOL; }
Examples
API Endpoints
All URIs are relative to https://api.elasticemail.com/v4
| Class | Method | HTTP request | Description |
|---|---|---|---|
| CampaignsApi | campaignsByNameDelete | DELETE /campaigns/{name} | Delete Campaign |
| CampaignsApi | campaignsByNameGet | GET /campaigns/{name} | Load Campaign |
| CampaignsApi | campaignsByNamePausePut | PUT /campaigns/{name}/pause | Pause Campaign |
| CampaignsApi | campaignsByNamePut | PUT /campaigns/{name} | Update Campaign |
| CampaignsApi | campaignsGet | GET /campaigns | Load Campaigns |
| CampaignsApi | campaignsPost | POST /campaigns | Add Campaign |
| ContactsApi | contactsByEmailDelete | DELETE /contacts/{email} | Delete Contact |
| ContactsApi | contactsByEmailGet | GET /contacts/{email} | Load Contact |
| ContactsApi | contactsByEmailPut | PUT /contacts/{email} | Update Contact |
| ContactsApi | contactsDeletePost | POST /contacts/delete | Delete Contacts Bulk |
| ContactsApi | contactsExportByIdStatusGet | GET /contacts/export/{id}/status | Check Export Status |
| ContactsApi | contactsExportPost | POST /contacts/export | Export Contacts |
| ContactsApi | contactsGet | GET /contacts | Load Contacts |
| ContactsApi | contactsImportPost | POST /contacts/import | Upload Contacts |
| ContactsApi | contactsPost | POST /contacts | Add Contact |
| DomainsApi | domainsByDomainDelete | DELETE /domains/{domain} | Delete Domain |
| DomainsApi | domainsByDomainGet | GET /domains/{domain} | Load Domain |
| DomainsApi | domainsByDomainPut | PUT /domains/{domain} | Update Domain |
| DomainsApi | domainsByDomainRestrictedGet | GET /domains/{domain}/restricted | Check for domain restriction |
| DomainsApi | domainsByDomainVerificationPut | PUT /domains/{domain}/verification | Verify Domain |
| DomainsApi | domainsByEmailDefaultPatch | PATCH /domains/{email}/default | Set Default |
| DomainsApi | domainsGet | GET /domains | Load Domains |
| DomainsApi | domainsPost | POST /domains | Add Domain |
| EmailsApi | emailsByMsgidViewGet | GET /emails/{msgid}/view | View Email |
| EmailsApi | emailsByTransactionidStatusGet | GET /emails/{transactionid}/status | Get Status |
| EmailsApi | emailsMergefilePost | POST /emails/mergefile | Send Bulk Emails CSV |
| EmailsApi | emailsPost | POST /emails | Send Bulk Emails |
| EmailsApi | emailsTransactionalPost | POST /emails/transactional | Send Transactional Email |
| EventsApi | eventsByTransactionidGet | GET /events/{transactionid} | Load Email Events |
| EventsApi | eventsChannelsByNameExportPost | POST /events/channels/{name}/export | Export Channel Events |
| EventsApi | eventsChannelsByNameGet | GET /events/channels/{name} | Load Channel Events |
| EventsApi | eventsChannelsExportByIdStatusGet | GET /events/channels/export/{id}/status | Check Channel Export Status |
| EventsApi | eventsExportByIdStatusGet | GET /events/export/{id}/status | Check Export Status |
| EventsApi | eventsExportPost | POST /events/export | Export Events |
| EventsApi | eventsGet | GET /events | Load Events |
| FilesApi | filesByNameDelete | DELETE /files/{name} | Delete File |
| FilesApi | filesByNameGet | GET /files/{name} | Download File |
| FilesApi | filesByNameInfoGet | GET /files/{name}/info | Load File Details |
| FilesApi | filesGet | GET /files | List Files |
| FilesApi | filesPost | POST /files | Upload File |
| InboundRouteApi | inboundrouteByIdDelete | DELETE /inboundroute/{id} | Delete Route |
| InboundRouteApi | inboundrouteByIdGet | GET /inboundroute/{id} | Get Route |
| InboundRouteApi | inboundrouteByIdPut | PUT /inboundroute/{id} | Update Route |
| InboundRouteApi | inboundrouteGet | GET /inboundroute | Get Routes |
| InboundRouteApi | inboundrouteOrderPut | PUT /inboundroute/order | Update Sorting |
| InboundRouteApi | inboundroutePost | POST /inboundroute | Create Route |
| ListsApi | listsByListnameContactsGet | GET /lists/{listname}/contacts | Load Contacts in List |
| ListsApi | listsByNameContactsPost | POST /lists/{name}/contacts | Add Contacts to List |
| ListsApi | listsByNameContactsRemovePost | POST /lists/{name}/contacts/remove | Remove Contacts from List |
| ListsApi | listsByNameDelete | DELETE /lists/{name} | Delete List |
| ListsApi | listsByNameGet | GET /lists/{name} | Load List |
| ListsApi | listsByNamePut | PUT /lists/{name} | Update List |
| ListsApi | listsGet | GET /lists | Load Lists |
| ListsApi | listsPost | POST /lists | Add List |
| SecurityApi | securityApikeysByNameDelete | DELETE /security/apikeys/{name} | Delete ApiKey |
| SecurityApi | securityApikeysByNameGet | GET /security/apikeys/{name} | Load ApiKey |
| SecurityApi | securityApikeysByNamePut | PUT /security/apikeys/{name} | Update ApiKey |
| SecurityApi | securityApikeysGet | GET /security/apikeys | List ApiKeys |
| SecurityApi | securityApikeysPost | POST /security/apikeys | Add ApiKey |
| SecurityApi | securitySmtpByNameDelete | DELETE /security/smtp/{name} | Delete SMTP Credential |
| SecurityApi | securitySmtpByNameGet | GET /security/smtp/{name} | Load SMTP Credential |
| SecurityApi | securitySmtpByNamePut | PUT /security/smtp/{name} | Update SMTP Credential |
| SecurityApi | securitySmtpGet | GET /security/smtp | List SMTP Credentials |
| SecurityApi | securitySmtpPost | POST /security/smtp | Add SMTP Credential |
| SegmentsApi | segmentsByNameDelete | DELETE /segments/{name} | Delete Segment |
| SegmentsApi | segmentsByNameGet | GET /segments/{name} | Load Segment |
| SegmentsApi | segmentsByNamePut | PUT /segments/{name} | Update Segment |
| SegmentsApi | segmentsGet | GET /segments | Load Segments |
| SegmentsApi | segmentsPost | POST /segments | Add Segment |
| StatisticsApi | statisticsCampaignsByNameGet | GET /statistics/campaigns/{name} | Load Campaign Stats |
| StatisticsApi | statisticsCampaignsGet | GET /statistics/campaigns | Load Campaigns Stats |
| StatisticsApi | statisticsChannelsByNameGet | GET /statistics/channels/{name} | Load Channel Stats |
| StatisticsApi | statisticsChannelsGet | GET /statistics/channels | Load Channels Stats |
| StatisticsApi | statisticsGet | GET /statistics | Load Statistics |
| SubAccountsApi | subaccountsByEmailCreditsPatch | PATCH /subaccounts/{email}/credits | Add, Subtract Email Credits |
| SubAccountsApi | subaccountsByEmailDelete | DELETE /subaccounts/{email} | Delete SubAccount |
| SubAccountsApi | subaccountsByEmailGet | GET /subaccounts/{email} | Load SubAccount |
| SubAccountsApi | subaccountsByEmailSettingsEmailPut | PUT /subaccounts/{email}/settings/email | Update SubAccount Email Settings |
| SubAccountsApi | subaccountsGet | GET /subaccounts | Load SubAccounts |
| SubAccountsApi | subaccountsPost | POST /subaccounts | Add SubAccount |
| SuppressionsApi | suppressionsBouncesGet | GET /suppressions/bounces | Get Bounce List |
| SuppressionsApi | suppressionsBouncesImportPost | POST /suppressions/bounces/import | Add Bounces Async |
| SuppressionsApi | suppressionsBouncesPost | POST /suppressions/bounces | Add Bounces |
| SuppressionsApi | suppressionsByEmailDelete | DELETE /suppressions/{email} | Delete Suppression |
| SuppressionsApi | suppressionsByEmailGet | GET /suppressions/{email} | Get Suppression |
| SuppressionsApi | suppressionsComplaintsGet | GET /suppressions/complaints | Get Complaints List |
| SuppressionsApi | suppressionsComplaintsImportPost | POST /suppressions/complaints/import | Add Complaints Async |
| SuppressionsApi | suppressionsComplaintsPost | POST /suppressions/complaints | Add Complaints |
| SuppressionsApi | suppressionsGet | GET /suppressions | Get Suppressions |
| SuppressionsApi | suppressionsUnsubscribesGet | GET /suppressions/unsubscribes | Get Unsubscribes List |
| SuppressionsApi | suppressionsUnsubscribesImportPost | POST /suppressions/unsubscribes/import | Add Unsubscribes Async |
| SuppressionsApi | suppressionsUnsubscribesPost | POST /suppressions/unsubscribes | Add Unsubscribes |
| TemplatesApi | templatesByNameDelete | DELETE /templates/{name} | Delete Template |
| TemplatesApi | templatesByNameGet | GET /templates/{name} | Load Template |
| TemplatesApi | templatesByNamePut | PUT /templates/{name} | Update Template |
| TemplatesApi | templatesGet | GET /templates | Load Templates |
| TemplatesApi | templatesPost | POST /templates | Add Template |
| VerificationsApi | verificationsByEmailDelete | DELETE /verifications/{email} | Delete Email Verification Result |
| VerificationsApi | verificationsByEmailGet | GET /verifications/{email} | Get Email Verification Result |
| VerificationsApi | verificationsByEmailPost | POST /verifications/{email} | Verify Email |
| VerificationsApi | verificationsFilesByIdDelete | DELETE /verifications/files/{id} | Delete File Verification Result |
| VerificationsApi | verificationsFilesByIdResultDownloadGet | GET /verifications/files/{id}/result/download | Download File Verification Result |
| VerificationsApi | verificationsFilesByIdResultGet | GET /verifications/files/{id}/result | Get Detailed File Verification Result |
| VerificationsApi | verificationsFilesByIdVerificationPost | POST /verifications/files/{id}/verification | Start verification |
| VerificationsApi | verificationsFilesPost | POST /verifications/files | Upload File with Emails |
| VerificationsApi | verificationsFilesResultGet | GET /verifications/files/result | Get Files Verification Results |
| VerificationsApi | verificationsGet | GET /verifications | Get Emails Verification Results |
| WebhookApi | webhookByPublicidDelete | DELETE /webhook/{publicid} | Delete Webhook |
| WebhookApi | webhookByPublicidGet | GET /webhook/{publicid} | Load Webhook |
| WebhookApi | webhookByPublicidPut | PUT /webhook/{publicid} | Update Webhook |
| WebhookApi | webhookGet | GET /webhook | Load Webhooks |
| WebhookApi | webhookPost | POST /webhook | Add Webhook |
Models
- AccessLevel
- AccountStatusEnum
- ApiKey
- ApiKeyPayload
- BodyContentType
- BodyPart
- Campaign
- CampaignOptions
- CampaignRecipient
- CampaignStatus
- CampaignTemplate
- CertificateValidationStatus
- ChannelLogStatusSummary
- CompressionFormat
- ConsentData
- ConsentTracking
- Contact
- ContactActivity
- ContactPayload
- ContactSource
- ContactStatus
- ContactUpdatePayload
- ContactsList
- DeliveryOptimizationType
- DomainData
- DomainDetail
- DomainOwner
- DomainPayload
- DomainUpdatePayload
- EmailContent
- EmailData
- EmailJobFailedStatus
- EmailJobStatus
- EmailMessageData
- EmailPredictedValidationStatus
- EmailRecipient
- EmailSend
- EmailStatus
- EmailTransactionalMessageData
- EmailValidationResult
- EmailValidationStatus
- EmailView
- EmailsPayload
- EncodingType
- EventType
- EventsOrderBy
- ExportFileFormats
- ExportLink
- ExportStatus
- FileInfo
- FilePayload
- FileUploadResult
- InboundPayload
- InboundRoute
- InboundRouteActionType
- InboundRouteFilterType
- ListPayload
- ListUpdatePayload
- LogJobStatus
- LogStatusSummary
- MergeEmailPayload
- MessageAttachment
- MessageCategory
- MessageCategoryEnum
- NewApiKey
- NewSmtpCredentials
- Options
- RecipientEvent
- Segment
- SegmentPayload
- SmtpCredentials
- SmtpCredentialsPayload
- SortOrderItem
- SplitOptimizationType
- SplitOptions
- SubAccountInfo
- SubaccountEmailCreditsPayload
- SubaccountEmailSettings
- SubaccountEmailSettingsPayload
- SubaccountPayload
- SubaccountSettingsInfo
- SubaccountSettingsInfoPayload
- Suppression
- Template
- TemplatePayload
- TemplateScope
- TemplateType
- TrackingType
- TrackingValidationStatus
- TransactionalRecipient
- Utm
- VerificationFileResult
- VerificationFileResultDetails
- VerificationStatus
- Webhook
- WebhookCreatePayload
- WebhookUpdatePayload
Authorization
Authentication schemes defined for the API:
apikey
- Type: API key
- API key parameter name: X-ElasticEmail-ApiKey
- Location: HTTP header
ApiKeyAuthCustomBranding
- Type: API key
- API key parameter name: X-Auth-Token
- Location: HTTP header
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
4.0.0- Package version:
4.0.28 - Generator version:
7.11.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen
elasticemail/elasticemail-php 适用场景与选型建议
elasticemail/elasticemail-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 110.65k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2021 年 05 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「rest」 「api」 「sdk」 「openapi」 「openapitools」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elasticemail/elasticemail-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elasticemail/elasticemail-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elasticemail/elasticemail-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
Alfabank REST API integration
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
BlockCypher's PHP SDK for REST API
Helper classes for creating cookie headers
统计信息
- 总下载量: 110.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 36
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: unlicense
- 更新时间: 2021-05-11