tigusigalpa/mailru
Composer 安装命令:
composer require tigusigalpa/mailru
包简介
MailRu for business SendBox service API
README 文档
README
PHP wrapper of Mail.Ru for business to work with the API. For the moment its only Sendbox integration. Official documentation https://help.mail.ru/biz/sendbox/api
Install
Client side
-
Add your domain to Mail.Ru. Approve domain via any available method: DNS TXT record or HTML file or HTML meta-tag or change domain NS records to mail.ru
-
Configure domain MX-records. Keep only Mail.Ru backed MX-records:
- Host/subdomain:
@ - Value:
emx.mail.ru - Priority:
10
- Host/subdomain:
-
Configure SPF-record (TXT domain record):
- Host/subdomain:
@ - Value:
v=spf1 redirect=_spf.mail.ru - TTL:
21600
If you are using any paid services like SMTP, your SPF-record may be another but only single one. For example, if you are using an SMTP service, SPF (TXT) record will be
v=spf1 include:send-box.ru include:smtp.send-box.ru redirect=_spf.mail.ru - Host/subdomain:
-
Configure DKIM signature. There may be a up to 3 DKIM records, depending on number of connected services.
-
Get API credentials. Go to https://mailer.i.bizml.ru/settings/, select an API tab, activate REST API, copy ID (CLIENT ID) and Secret (CLIENT SECRET).
Developer side
$ composer require tigusigalpa/mailru
require_once 'vendor/autoload.php';
Sendbox
$email = new \Tigusigalpa\MailRu\Sendbox\Email($client_id, $client_secret);
SMS
$sms = new \Tigusigalpa\MailRu\Sendbox\SMS($client_id, $client_secret);
SMTP
$smtp = new \Tigusigalpa\MailRu\Sendbox\SMTP($client_id, $client_secret);
Available methods
| Name | Arguments |
|---|---|
sendEmail(array $email) |
$email = ['html' => (string), 'text' => (string), 'template' => ['id' => (int), 'variables' => (string)], 'subject' => (string)] |
Coming soon...
PHPUnit tests
Use environment variables to test API:
- CLIENT_ID (required)
- CLIENT_SECRET (required)
- TIMEOUT (optional)
All coverage tests are coming soon...
License
MIT License
Author
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-10
