gmail@1.0.0
This adaptor exports the following from common:
- alterState()
- combine()
- cursor()
- dataPath()
- dataValue()
- each()
- field()
- fields()
- fn()
- fnIf()
- http
- lastReferenceValue()
- merge()
- sourceValue()
Functions
getContentsFromMessages
getContentsFromMessages(userId, userOptions) ⇒ function
Requests contents from messages of a Gmail account.
Returns: function
- A function that processes the state.
Param | Type | Description |
---|---|---|
userId | string | The email address of the account to retrieve messages from. |
userOptions | Options | Customized options including desired contents and query. |
Example
getContentsFromMessages(
'test@tester.com',
{
query: 'in:inbox subject:my+test+message',
desiredContents: ['date', 'from', 'subject', { type: 'body', maxLength: 50 }]
}
)
Interfaces
DesiredContent
Used to isolate the type of content to retrieve from the message.
Properties
Name | Type | Default | Description |
---|---|---|---|
type | string | Message content type. Valid types: from, date, subject, body, archive, file. | |
[name] | string | null | A custom description for the content type. Optional. |
[archive] | RegExp | string | Identifier to isolate the desired attachment when type is 'archive'. Use a regular expression for pattern matching or a string for a literal match. Required if type is 'archive'. | |
[file] | RegExp | string | Identifier to isolate the desired attachment when type is 'file' or 'archive'. Use a regular expression for pattern matching or a string for a literal match. Required if type is 'file' or 'archive'. | |
[maxLength] | number |
| Maximum number of characters to retrieve from the content. Optional. |
Options
Configurable options provided to the Gmail adaptor.
Properties
Name | Type | Default | Description |
---|---|---|---|
userId | string | The email address of the Gmail account. | |
[query] | string | null | Custom query to limit the messages result. Adheres to the Gmail search syntax. Optional. |
[desiredContents] | Array.<(string|DesiredContent)> | ['from', 'date', 'subject', 'body'] | An array of strings or DesiredContent objects used to specify which parts of the message to retrieve. Optional, default is ['from', 'date', 'subject', 'body'] . |
[processedIds] | Array.<string> |
| Ignore message ids which have already been processed. Optional. |