Forwards each new Gmail email that mentions one of your keywords to the address you choose, as soon as it arrives.

UsesGmail

Forward emails that mention a keyword

Whenever a new email arrives in your Gmail inbox, the workflow looks for the words or phrases you choose in its subject and body. When one turns up, the email is forwarded from your Gmail account to the address you picked, opening with a line that names the keyword it matched, followed by the original sender, date, subject and recipients.

Matching ignores case, and you can limit it to the subject line for a stricter filter. Emails that mention none of your keywords are left alone. A copy the workflow forwarded is recognised and never forwarded again, so sending to your own address is safe. You can also narrow the trigger to one sender or domain so the workflow only looks at mail from there.

The forward is plain text: an email that only has an HTML version is converted to readable text, a very long one is cut with a note saying so, and attachments are not carried over.

GmailGmailWhen an email arrives. Save it as email.When an email arrives. Save it as email.
ValuesSet forwardTo to blank.Set forwardTo to blank.
ValuesSet keywords to an empty list.Set keywords to an empty list.
ValuesSet searchBody to true.Set searchBody to true.
CodeRun Python code on keywords, subject, sender, recipients, and date and save it as tidy.Run Python code on keywords, subject, sender, recipients, and date and save it as tidy.
Decisions & LoopsIf tidy.keywords is emptyIf tidy.keywords is empty
Yes
Decisions & LoopsStop and report a problem: Add at least one word or phrase to 'keywords' at the top of this workflow, such as 'invoice', then run it again. An email is forwarded when it mentions any one of them.Stop and report a problem: Add at least one word or phrase to 'keywords' at the top of this workflow, such as 'invoice', then run it again. An email is forwarded when it mentions any one of them.
No
No steps
ValuesSet readableBody to blank.Set readableBody to blank.
ValuesSet bodyToSearch to blank.Set bodyToSearch to blank.
Decisions & LoopsIf a step below fails, save the error as bodyErrorIf a step below fails, save the error as bodyError
Try
CodeRun Python code on body and full_length and save it as converted.Run Python code on body and full_length and save it as converted.
ValuesChange readableBody to converted.text.Change readableBody to converted.text.
ValuesChange bodyToSearch to converted.text.Change bodyToSearch to converted.text.
On error
ValuesChange readableBody to [This email's body could not be included here: it is too large or could not be turned into text. Open the original in Gmail to read it.].Change readableBody to [This email's body could not be included here: it is too large or could not be turned into text. Open the original in Gmail to read it.].
ValuesChange bodyToSearch to email.body.Change bodyToSearch to email.body.
TextBuild the text @tidy.subject @bodyToSearch and save it as searchedText.Build the text @tidy.subject @bodyToSearch and save it as searchedText.
Decisions & LoopsIf searchedText contains Forwarded automatically because it mentions "If searchedText contains Forwarded automatically because it mentions "
Yes
Decisions & LoopsFinish the run: Skipped: this is a copy this workflow already forwarded, so it is not forwarded again.Finish the run: Skipped: this is a copy this workflow already forwarded, so it is not forwarded again.
No
No steps
Decisions & LoopsIf searchBody is noIf searchBody is no
Yes
ValuesChange searchedText to tidy.subject.Change searchedText to tidy.subject.
No
No steps
ValuesSet matchedKeyword to blank.Set matchedKeyword to blank.
Decisions & LoopsFor each keyword in tidy.keywords:For each keyword in tidy.keywords:
TextTrim keyword and save it as term.Trim keyword and save it as term.
Decisions & LoopsIf term isn't blank and searchedText contains term (ignoring case)If term isn't blank and searchedText contains term (ignoring case)
Yes
ValuesChange matchedKeyword to term.Change matchedKeyword to term.
Decisions & LoopsStop repeating.Stop repeating.
No
No steps
Decisions & LoopsIf matchedKeyword is blankIf matchedKeyword is blank
Yes
Decisions & LoopsFinish the run: Skipped: this email does not mention any of your keywords.Finish the run: Skipped: this email does not mention any of your keywords.
No
No steps
GmailGmailSend an email to forwardTo. Save it as forwarded.Send an email to forwardTo. Save it as forwarded. Subject: Fwd: tidy.subjectForwarded automatically because it mentions "@matchedKeyword". ---------- Forwarded message --------- From: tidy.from Date: tidy.date Subject: tidy.subject To: tidy.to ...