yonoma/yonoma-php
最新稳定版本:1.0.0
Composer 安装命令:
composer require yonoma/yonoma-php
包简介
The official PHP client library for the Yonoma Email Marketing API
README 文档
README
The official PHP client library for the Yonoma Email Marketing API
Installation
Install via Packagist
composer require yonoma/yonoma-php
Or add the following to composer.json
{
"require": {
"yonoma/yonoma-php": "*"
}
}
Quick Start
Note : This SDK requires PHP version 7.4 or above.
require_once('/Yonoma/vendor/autoload.php'); $yonoma = new Yonoma\ApiClient('YOUR-API-KEY');
Send an Email
$response = $yonoma->email->sendEmail([ "from_email" => "updates@yonoma.io", "to_email" => "email@yourdomain.com", "subject" => "Welcome to Yonoma - You're In!", "mail_template" => "We're excited to welcome you to Yonoma! Your successful signup marks the beginning of what we hope will be an exceptional journey." ]);
Lists
Create new list
$response = $yonoma->lists->create([ "list_name" => "New list" ]);
Get list of lists
$response = $yonoma->lists->list();
Get one list
$response = $yonoma->lists->retrieve('list id');
Update list
$response = $yonoma->lists->update('list id',[ "list_name" => "Updated list name" ]);
Delete list
$response = $yonoma->lists->delete('list id');
Tags
Create new tag
$response = $yonoma->tags->create([ "tag_name" => "New tag" ]);
Get list of tags
$response = $yonoma->tags->list();
Get one tag
$response = $yonoma->tags->retrieve('Tag id');
Update tag
$response = $yonoma->tags->update('Tag id',[ "tag_name" => "Updated tag name" ]);
Delete tag
$response = $yonoma->tags->delete('Tag id');
Contacts
Create new contact
$response = $yonoma->contacts->create("list id", [ "email" => "email@example.com", "status" => "Subscribed" | "Unsubscribed", "firstName" => "Contact", //optional "lastName" => "One", //optional "phone" => "1234567890", //optional "address" => "123, NY street", //optional "city" => "NY City", //optional "state" => "NY", //optional "country" => "US", //optional "zipcode" => "10001" //optional ]);
Update contact
$response = $yonoma->contacts->update("list id", "Contact id", [ "status" => "Subscribed" | "Unsubscribed", ]);
Add tag to contact
$response = $yonoma->contacts->addTag("Contact id", [ "tag_id" => "Tag id", ]);
Remove tag from contact
$response = $yonoma->contacts->removeTag("Contact id", [ "tag_id" => "Tag id", ]);
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-21