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.