bordeux/email-cleaner

This package is abandoned and no longer maintained. No replacement package was suggested.

Replay email cleaner/remover for PHP

0.6.1 2015-02-13 08:49 UTC

This package is not auto-updated.

Last update: 2022-05-16 17:52:20 UTC


README

Class removes all previus replay messages, leave only new content.

Installation

composer require "bordeux/email-cleaner"

or

{
	"bordeux/email-cleaner": "dev-master"
}

Example usage

<?php
use EmailCleaner\EmailCleaner;
    $emailCleaner = new EmailCleaner();
    $simpeEmailHTMLContent = "<your html email code>";
    $emailCleaner->setHTML($simpeEmailHTMLContent);
    $resultHTML = $emailCleaner->parse();
    var_dump($resultHTML); //html only with response to email
?>

Custom filters

<?php
use EmailCleaner\EmailCleaner;
use EmailCleaner\FilterAbstract;

class YourCustomFilter extends FilterAbstract {
    public function run() {
        $this->dom->find(".gmail_extra")->remove();
    }
}

    $emailCleaner = new EmailCleaner();
    $emailCleaner->addFilter(new YourCustomFilter());
    
    $simpeEmailHTMLContent = "<your html email code>";
    $emailCleaner->setHTML($simpeEmailHTMLContent);
    $resultHTML = $emailCleaner->parse();
    var_dump($resultHTML); //html only with response to email
?>
Thank you to:
  • Tobiasz Cudnik < phpQuery > - CSS2XPATH parser