forked from ahochsteger/gmail-processor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathConfig.gs
58 lines (52 loc) · 2.32 KB
/
Config.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Configuration for Gmail2GDrive
*/
function getGmail2GDriveConfig() {
return {
// Gmail label for processed threads (will be created, if not existing):
"processedLabel": "to-gdrive/processed",
// Sleep time in milli seconds between processed messages:
"sleepTime": 100,
// Maximum script runtime in seconds (google scripts will be killed after 5 minutes):
"maxRuntime": 280,
// Only process message newer than (leave empty for no restriction; use d, m and y for day, month and year):
"newerThan": "1m",
// Timezone for date/time operations:
"timezone": "GMT",
// Processing rules:
"rules": [
// Rule parameter documentation:
// * filter (String, mandatory): a typical gmail search expression (see http://support.google.com/mail/bin/answer.py?hl=en&answer=7190)
// * folder (String, mandatory): a path to an existing Google Drive folder (will be created, if not existing)
// * saveThreadPDF (boolean, option): Should the thread be saved as a PDF? (default: false)
// * archive (boolean, optional): Should the gmail thread be archived after processing? (default: false)
// * filenameFrom (String, optional): The attachment filename that should be renamed when stored in Google Drive
// * filenameTo (String, optional): The pattern for the new filename of the attachment. You can use '%s' to insert the email subject and date format patterns like 'yyyy' for year, 'MM' for month and 'dd' for day as pattern in the filename.
// See https://developers.google.com/apps-script/reference/utilities/utilities#formatDate(Date,String,String) for more information on the possible date format strings.
{
"filter": "to:[email protected]",
"folder": "Scans"
},
{
"filter": "from:[email protected]",
"folder": "Examples/example1"
},
{
"filter": "from:[email protected]",
"folder": "Examples/example2"
},
{
"filter": "label:PDF",
"saveThreadPDF": true,
"folder": "PDF Emails"
},
{
"filter": "(from:[email protected] OR from:[email protected])",
"folder": "Examples/example3ab",
"filenameFrom": "file.txt",
"filenameTo": "'file-'yyyy-MM-dd-'%s.txt'",
"archive": true
}
]
};
}