https://github.com/tpmanc/tiu-mailbox
Get tiu.ru orders and messages from mailbox
https://github.com/tpmanc/tiu-mailbox
Last synced: 18 days ago
JSON representation
Get tiu.ru orders and messages from mailbox
- Host: GitHub
- URL: https://github.com/tpmanc/tiu-mailbox
- Owner: tpmanc
- Created: 2016-09-28T09:38:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-14T06:46:22.000Z (almost 8 years ago)
- Last Synced: 2025-02-13T19:28:56.438Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tiu-mail
Get tiu.ru orders and messages from mailbox.
## REQUIREMENTS
* [php imap extension](http://php.net/manual/imap.setup.php)
## Install via Composer
Run the following command
```bash
$ composer require tpmanc/tiu-mailbox "*"
```or add
```bash
$ "tpmanc/tiu-mailbox": "*"
```to the require section of your `composer.json` file.
## Usage
```php
$tiu = new tpmanc\tiu\Tiu('{imap.yandex.ru:993/imap/ssl}INBOX', '[email protected]', '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
```php
...$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
```php
...$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();
}
...
```