mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-01-22 20:17:31 +00:00
Merge branch 'list-method'
This commit is contained in:
commit
f25ce7f9f1
|
@ -55,6 +55,7 @@ _Conditions that a message must satisfy for the filter to be applied:_
|
|||
- `to` - if the message is to a certain name or email address.
|
||||
- `subject` - if the message has a certain subject.
|
||||
- `hasAttachment` - if the message has an attachment.
|
||||
- `list` - if the message is from a mailing list.
|
||||
- `excludeChats` - exclude chats from the results (false by default).
|
||||
|
||||
### Actions
|
||||
|
|
|
@ -97,6 +97,20 @@ class Filter
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter a message if it was sent from a mailing list.
|
||||
*
|
||||
* @param $value The mailing list address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function list($value)
|
||||
{
|
||||
$this->has("list:{$value}");
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
|
|
|
@ -134,6 +134,17 @@ class FilterTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::list
|
||||
*/
|
||||
public function testList()
|
||||
{
|
||||
$this->assertEquals(
|
||||
['hasTheWord' => 'list:foobar'],
|
||||
$this->filter->list('foobar')->toArray()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::excludeChats
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue