Placeholder
The placeholder in the following table are available for substitution in strings, depending on the scope which are defined as follows:
Environment Placeholder
These placeholder are valid globally and can also be used for internal purposes before processing starts (e.g. during adapter initialization).
Key | Title | Description | Example |
---|---|---|---|
date.now | Current Timestamp | The current timestamp. Use "${<key>:date::<format>}" to format the date/time using a custom date-fns format strings (default: "yyyy-MM-dd HH:mm:ss" ). | 2023-06-26 09:00:00 |
env.runMode | Runmode | The runMode used for processing. | safe-mode |
env.timezone | Timezone | The timezone used for processing. | Etc/UTC |
lib.description | Library Description | The description of the Gmail Processor library. | |
lib.name | Library Name | The name of the Gmail Processor library. | gmail-processor |
lib.version | Library Version | The version of the Gmail Processor library. | 0.0.0 |
user.email | User Email | The email address of the active user. | my.email@gmail.com |
Processing Placeholder
These placeholder are valid globally during any processing phase.
Key | Title | Description | Example |
---|---|---|---|
timer.startTime | Timer Start Time | The start timestamp of the processing script. Use "${<key>:date::<format>}" to format the date/time using a custom date-fns format strings (default: "yyyy-MM-dd HH:mm:ss" ). | 2023-06-26 09:00:00 |
variables.customVar | Variable customVar | A custom defined variable. Custom variables defined at global.variables to better manage recurring substitution values. | Custom value |
Thread Placeholder
These placeholder are valid during processing a GMail thread and matching messages + attachments.
Key | Title | Description | Example |
---|---|---|---|
thread.firstMessageSubject | Thread Subject | The subject of the first message in the thread. See GmailThread.getFirstMessageSubject() reference docs. | Message Subject 1 |
thread.hasStarredMessages | Starred Messages | true if the thread has any starred messages. See GmailThread.hasStarredMessages() reference docs. | false |
thread.id | Thread ID | The ID of the thread. See GmailThread.getId() reference docs. | threadId123 |
thread.index | Thread Index | The index number (0-based) of the thread. | 0 |
thread.isImportant | Important Thread | true if the thread is marked as important. See GmailThread.isImportant() reference docs. | false |
thread.isInChats | Chat Thread | true if the thread is labeled a chat. See GmailThread.isInChats() reference docs. | false |
thread.isInInbox | Inbox Thread | true if the thread is in the inbox. See GmailThread.isInInbox() reference docs. | true |
thread.isInPriorityInbox | Priority Inbox Thread | true if the thread is in the priority inbox. See GmailThread.isInPriorityInbox() reference docs. | false |
thread.isInSpam | Spam Thread | true if the thread is marked as spam. See GmailThread.isInSpam() reference docs. | false |
thread.isInTrash | Trash Thread | true if the thread is marked as spam. See GmailThread.isInTrash() reference docs. | false |
thread.isUnread | Unread Thread | true if the thread has any unread messages. See GmailThread.isUnread() reference docs. | true |
thread.labels | Thread Labels | The user-created labels on the thread. See GmailThread.getLabels() reference docs. | |
thread.lastMessageDate | Thread Date | The date of the thread's most recent message. See GmailThread.getLastMessageDate() reference docs. Use "${<key>:date::<format>}" to format the date/time using a custom date-fns format strings (default: "yyyy-MM-dd HH:mm:ss" ). | 2019-05-02 07:15:28 |
thread.matched | thread Regex Matches | The overall matching result for all conditions in the match config. | true |
thread.messageCount | Thread Message Count | The number of messages in the thread. See GmailThread.getMessageCount() reference docs. | 2 |
thread.permalink | Thread Permalink | The permalink for the thread. See GmailThread.getPermalink() reference docs. | some-permalink-url |
thread.url | Thread URL | The URL of the thread. | https://mail.google.com/mail/u/0... |
threadConfig.index | Thread Config Index | The index number (0-based) of the thead config. | 0 |
Message Placeholder
These placeholder are valid during processing a GMail message and matching attachments.
Key | Title | Description | Example |
---|---|---|---|
message.bcc | Message BCC | The comma-separated recipients bcc'd on the message. See GmailMessage.getBcc() reference docs. | message-bcc@example.com |
message.body | Message Body | The body of the message. See GmailMessage.getBody() reference docs. | <p>Message body with contained u... |
message.body.match.1 | message.body Regex Match Group 1 | The matching regex group number as defined in the match config (e.g.: "(?<url>https://raw\\.githubusercontent\\.com/ahochsteger/gmail-processor/main/src/e2e-test/files/(?<filename>[0-9A-Za-z_-]+\\.txt))" ). | https://raw.githubusercontent.co... |
message.body.match.2 | message.body Regex Match Group 2 | The matching regex group number as defined in the match config (e.g.: "(?<url>https://raw\\.githubusercontent\\.com/ahochsteger/gmail-processor/main/src/e2e-test/files/(?<filename>[0-9A-Za-z_-]+\\.txt))" ). | plain-text-from-repo.txt |
message.body.match.filename | message.body Regex Match Group filename | The matching named regex group name as defined in the match config (e.g.: "(?<url>https://raw\\.githubusercontent\\.com/ahochsteger/gmail-processor/main/src/e2e-test/files/(?<filename>[0-9A-Za-z_-]+\\.txt))" ). | plain-text-from-repo.txt |
message.body.match.url | message.body Regex Match Group url | The matching named regex group name as defined in the match config (e.g.: "(?<url>https://raw\\.githubusercontent\\.com/ahochsteger/gmail-processor/main/src/e2e-test/files/(?<filename>[0-9A-Za-z_-]+\\.txt))" ). | https://raw.githubusercontent.co... |
message.cc | Message CC | The comma-separated recipients cc'd on the message. See GmailMessage.getCc() reference docs. | message-cc@example.com |
message.date | Message Date | The date and time of the message. See GmailMessage.getDate() reference docs. Use "${<key>:date::<format>}" to format the date/time using a custom date-fns format strings (default: "yyyy-MM-dd HH:mm:ss" ). | 2019-05-02 07:15:28 |
message.from | Sender | The sender of the message. See GmailMessage.getFrom() reference docs. | message-from@example.com |
message.from.domain | Sender Domain | The sender domain of the message. See GmailMessage.getFrom() reference docs. | example.com |
message.from.match.1 | message.from Regex Match Group 1 | The matching regex group number as defined in the match config (e.g.: "(.+)@example.com" ). | message-from |
message.id | Message ID | The ID of the message. See GmailMessage.getId() reference docs. | message-id |
message.index | Message Index | The index number (0-based) of the message. | 0 |
message.isDraft | Draft Message | true if the message is a draft. See GmailMessage.isDraft() reference docs. | false |
message.isInChats | Chat Message | true if the message is a chat. See GmailMessage.isInChats() reference docs. | false |
message.isInInbox | Inbox Message | true if the message is in the inbox. See GmailMessage.isInInbox() reference docs. | true |
message.isInPriorityInbox | Priority Inbox Message | true if if the message is in the priority inbox. See GmailMessage.isInPriorityInbox() reference docs. | false |
message.isInTrash | Trash Message | true if the message is in the trash. See GmailMessage.isInTrash() reference docs. | false |
message.isStarred | Starred Message | true if the message is starred. See GmailMessage.isStarred() reference docs. | false |
message.isUnread | Unread Message | true if the message is unread. See GmailMessage.isUnread() reference docs. | true |
message.matched | message Regex Matches | The overall matching result for all conditions in the match config. | true |
message.plainBody | Message Plain Body | The plain body of the message. See GmailMessage.getPlainBody() reference docs. | |
message.replyTo | Message Reply To | The reply-to address of the message (usually the sender). See GmailMessage.getReplyTo() reference docs. | message-reply-to@example.com |
message.subject | Message Subject | The subject of the message. See GmailMessage.getSubject() reference docs. | Message Subject 1 |
message.subject.match.1 | message.subject Regex Match Group 1 | The matching regex group number as defined in the match config (e.g.: "Message (?<myMatchGroup>.*)" ). | Subject 1 |
message.subject.match.myMatchGroup | message.subject Regex Match Group myMatchGroup | The matching named regex group name as defined in the match config (e.g.: "Message (?<myMatchGroup>.*)" ). | Subject 1 |
message.to | Message To | The comma-separated recipients of the message. See GmailMessage.getTo() reference docs. | message-to@example.com |
message.url | Message URL | The URL of the message. | https://mail.google.com/mail/u/0... |
messageConfig.index | Message Config Index | The index number (0-based) of the message config. | 0 |
Attachment Placeholder
These placeholder are valid during processing a GMail attachment.
Key | Title | Description | Example |
---|---|---|---|
attachment.contentType | Attachment Content Type | The content type of the attachment. See GmailAttachment.getContentType() reference docs. | application/pdf |
attachment.contentType.match.1 | attachment.contentType Regex Match Group 1 | The matching regex group number as defined in the match config (e.g.: "application/(?<appType>.*)" ). | pdf |
attachment.contentType.match.appType | attachment.contentType Regex Match Group appType | The matching named regex group name as defined in the match config (e.g.: "application/(?<appType>.*)" ). | pdf |
attachment.hash | Attachment Hash | The SHA1 content hash for the attachment. See GmailAttachment.getHash() reference docs. | aa0b8cc192a5d8d5b5d8ecda24fd0961... |
attachment.index | Attachment Index | The index number (0-based) of the attachment. | 0 |
attachment.isGoogleType | Google Type Attachment | true if this attachment is a Google Workspace file (Sheets, Docs, etc.). See GmailAttachment.isGoogleType() reference docs. | false |
attachment.matched | attachment Regex Matches | The overall matching result for all conditions in the match config. | true |
attachment.name | Attachment Name | The name of the attachment. See GmailAttachment.getName() reference docs. | attachment1.pdf |
attachment.name.match.1 | attachment.name Regex Match Group 1 | The matching regex group number as defined in the match config (e.g.: "attachment(?<attNr>[0-9]+)\\.pdf" ). | 1 |
attachment.name.match.attNr | attachment.name Regex Match Group attNr | The matching named regex group name as defined in the match config (e.g.: "attachment(?<attNr>[0-9]+)\\.pdf" ). | 1 |
attachment.size | Attachment Size | The size of the attachment. See GmailAttachment.getSize() reference docs. | 18 |
attachmentConfig.index | Attachment Config Index | The index number (0-based) of the attachment config. | 0 |
Action Placeholder
These placeholder are valid after certain actions have been executed.
Key | Title | Description | Example |
---|---|---|---|
attachment.docsFile.stored.downloadUrl | Stored Download URL | The download URL of the stored OCR docs file (using action attachment.extractText ) | |
attachment.docsFile.stored.id | Stored ID | The ID of the stored OCR docs file (using action attachment.extractText ) | created-docs-file-id |
attachment.docsFile.stored.location | Stored Location | The location of the stored OCR docs file (using action attachment.extractText ) | created-docs-file |
attachment.docsFile.stored.url | Stored URL | The URL of the stored OCR docs file (using action attachment.extractText ) | |
attachment.extracted | Extracted Text | The extracted text from the attachment (using action attachment.extractText ) | ...<br>Invoice date: 2024-03-13<br>Inv... |
attachment.extracted.match.1 | attachment.extracted Regex Match Group 1 | The matching regex group number as defined in the match config (e.g.: "Invoice date:\\s*(?<invoiceDate>[0-9-]+)\\s*Invoice number:\\s*(?<invoiceNumber>[0-9]+)" ). | 2024-03-13 |
attachment.extracted.match.2 | attachment.extracted Regex Match Group 2 | The matching regex group number as defined in the match config (e.g.: "Invoice date:\\s*(?<invoiceDate>[0-9-]+)\\s*Invoice number:\\s*(?<invoiceNumber>[0-9]+)" ). | 12345678 |
attachment.extracted.match.invoiceDate | attachment.extracted Regex Match Group invoiceDate | The matching named regex group name as defined in the match config (e.g.: "Invoice date:\\s*(?<invoiceDate>[0-9-]+)\\s*Invoice number:\\s*(?<invoiceNumber>[0-9]+)" ). | 2024-03-13 |
attachment.extracted.match.invoiceNumber | attachment.extracted Regex Match Group invoiceNumber | The matching named regex group name as defined in the match config (e.g.: "Invoice date:\\s*(?<invoiceDate>[0-9-]+)\\s*Invoice number:\\s*(?<invoiceNumber>[0-9]+)" ). | 12345678 |
Date Expressions
These are the supported date expressions that can be used in date
substitutions like ${message.date:date:lastDayOfMonth-2d:yyyy-MM-dd HH:mm:ss}
.