Skip to content

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-parser

Requirements ​

  • 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 ​

Released under the MIT License.