Getting Started
Bank Mails Parser is a professional PHP library for parsing confirmation emails from Slovak and Czech banks. It automatically extracts transaction details like amounts, account numbers, variable symbols, and more.
Installation
Install via Composer:
bash
composer require tomaj/bank-mails-parserRequirements
- PHP 8.4 or 8.5
- Composer
Quick Start
Here's a simple example parsing a TatraBanka notification email:
php
<?php
use Tomaj\BankMailsParser\BankMailsParser;
require 'vendor/autoload.php';
$parser = new BankMailsParser();
$mailContent = $parser->parse($emailBody, $sender, $subject);
echo $mailContent->money?->toDecimalString() . ' ' . $mailContent->money?->currency->value . "\n";
echo $mailContent->vs . "\n";
echo $mailContent->accountNumber . "\n";
echo $mailContent->transactionDate?->format('Y-m-d') . "\n";parse() throws when the email cannot be read. tryParse() returns null instead. See Bank Detection and Exceptions.
Supported Banks
- TatraBanka (SK) - Standard notifications, ComfortPay, and PGP-encrypted statements
- ČSOB (CZ) - Multi-transaction mail. Pass the decoded plain text; HTML is not parsed.
- ČSOB (SK) - Multi-transaction mail. Pass the decoded plain text; HTML is not parsed.
- VÚB (SK) - Plain text notifications
Next Steps
- Learn about Examples to see various parsing scenarios
- Detect the bank with BankMailsParser
- Handle exceptions
- Check bank-specific guides: TatraBanka, ČSOB CZ, ČSOB SK, VÚB
- See the API Reference for complete method documentation
- Learn how to add a new bank parser