tpmanc/tiu-mailbox

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Get tiu.ru orders and messages from mailbox

dev-master 2017-06-14 06:46 UTC

This package is not auto-updated.

Last update: 2021-10-16 03:57:37 UTC


README

Get tiu.ru orders and messages from mailbox.

REQUIREMENTS

Install via Composer

Run the following command

$ composer require tpmanc/tiu-mailbox "*"

or add

$ "tpmanc/tiu-mailbox": "*"

to the require section of your composer.json file.

Usage

$tiu = new tpmanc\tiu\Tiu('{imap.yandex.ru:993/imap/ssl}INBOX', 'login@ya.ru', 'password');
$tiu = $tiu->setLimit(50); // set mail count per page (default = 20)
$pageCount = $tiu->getPageCount(); // get page count
$tiu = $tiu->getByPage(0); // find tiu emails on first page

$messages = $tiu->getMessages(); // get array of user messages
$orders = $tiu->getOrders(); // get array of user orders

$tiu->close();

Message object

Info about user message

...

$messages = $tiu->getMessages(); // get array of user messages
foreach ($messages as $message) {
    echo 'tiu id: ' . $message->getId();
    echo 'theme: ' . $message->getTitle();
    echo 'link: ' . $message->getLink();
}
...

Order object

Info about user order

...

$orders = $tiu->getOrders(); // get array of user orders
foreach ($orders as $order) {
    echo 'tiu id: ' . $message->getId();
    echo 'name: ' . $message->getUsername();
    echo 'link: ' . $message->getLink();
}
...