Update example code

This commit is contained in:
Oliver Davies 2016-12-05 20:02:43 +00:00
parent d01f1489e0
commit 2b28a547a6

View file

@ -19,15 +19,17 @@ For example:
require __DIR__ '/vendor/autoload.php';
use Opdavies\GmailFilterBuilder\Builder;
use Opdavies\GmailFilterBuilder\Filter;
$filters = [];
$filters[] = GmailFilter::create()
->from(['example@test.com'])
->label('Test')
->archive()
->neverSpam();
$filters[] = Filter::create()
->has('from:example@test.com')
->labelAndArchive('Test')
->neverSpam();
print GmailFilterBuilder::build($filters);
new Builder($filters);
```
In this case, an email from `example@test.com` would be archived, never marked as spam, and have a label of "Test" added to it.