Open
Conversation
This was referenced Aug 6, 2022
c280cc7 to
8503e7c
Compare
Contributor
Author
|
@ranmocy , What are your thoughts on adding a Or do you prefer something like: |
cb3f192 to
bcc6096
Compare
added 2 commits
August 18, 2022 18:21
Based on Issue ranmocy#36, allows matching on any header and value. ``` (header X-Custom-Header /value/) ``` As we use `GmailMessage.getHeader` function, the header name used in the condition must be case-sensitive. Overall flow: - Rules are parsed, and a list of condition-requested-headers is created. - ThreadData reads in the message data, and all the headers that were requested in the rules (we have to pass SessionData to ThreadData so it knows which headers to search). - Condition.match checks what header to match with, and compares the header's value with the rule's value. In order to get the SessionData.mock.ts to work, SessionData.labels had to be made public. This seems to be a limitation we will continue to hit in testing if we want to test on Sheet Apps, since we cannot use other better libraries.
Create rules that can match an email thread's details. Thread details include: - label - is_important - is_in_inbox - is_in_priority_inbox - is_in_spam - is_in_trash - is_starred - is_unread - first_message_subject For example, an email thread may already exist in the labels: - ABC - ABC/xyz - def When a new email is received that is for the same thread, the following rule can be used: (thread label ABC/xyz) Or you can check if an email thread is marked 'important': (thread is_important) Or you can check what the original thread subjectline was: (thread first_message_subject /This has no RE: in it/i)
bcc6096 to
e01bfc7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow matching message thread details.
Create rules that can match an email thread's details.
Thread details include:
(thread label ABC/xyz)(thread is_important)(thread is_in_inbox)(thread is_in_priority_inbox)(thread is_in_spam)(thread is_in_trash)(thread is_starred)(thread is_unread)(thread first_message_subject /has This Text/i)For example, an email thread may already exist in the labels:
Or you can check if an email thread is starred (resolves #11):
Or you can check what the original thread subjectline was (helping, but not resolving issue #17):