From 2b28a547a6c91e45b56182056587ae30f1fb4a8b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 5 Dec 2016 20:02:43 +0000 Subject: [PATCH] Update example code --- .../2016-07-15-building-gmail-filters-in-php.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/_posts/2016-07-15-building-gmail-filters-in-php.md b/source/_posts/2016-07-15-building-gmail-filters-in-php.md index bcef3450..93bcd21e 100644 --- a/source/_posts/2016-07-15-building-gmail-filters-in-php.md +++ b/source/_posts/2016-07-15-building-gmail-filters-in-php.md @@ -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.