bordeux / email-cleaner
Replay email cleaner/remover for PHP
Installs: 7 491
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Language:HTML
Requires
- php: >=5.4
- electrolinux/phpquery: >=0.9.6
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