FAQs
How do I test my configuration without risking unwanted changes to Gmail or GDrive?
Use the dry-run
mode:
function run() {
// NOTE: Switch to "safe-mode" after testing the config
GmailProcessorLib.run(config, "dry-run")
}
How do I migrate my configuration from GMail2GDrive to Gmail Processor?
Use the playground. See Migrating from GMail2GDrive for details.
How do I use my own customized version of the Gmail Processor library?
See Getting Started - Copy the Library Code.
How do I use multiple configurations within a single Google Apps Script project?
Make sure to give all variables and functions unique names since they all share the same namespace - even if located in different *.gs
files:
var config1 = {...}
function run1() {
GmailProcessorLib.run(config1, ...)
}
var config2 = {...}
function run2() {
GmailProcessorLib.run(config2, ...)
}
How do I store GDrive attachments in emails?
Use the following config snippet to extract the fileId and filename of the GDrive attachment from the email body and use it for the download URL of the message.storeFromURL
action:
{
"match": {
"body": "(?s)<a href=\"https://drive.google.com/file/d/(?<fileId>[^/]+)/view\\?usp=drivesdk\".*<span [^>]+>(?<filename>[^<]+)</span>"
},
"actions": [
{
"name": "message.storeFromURL",
"args": {
"url": "https://drive.google.com/uc?id=${message.body.match.fileId}&export=download",
"location": "/some-path/${message.body.match.filename}",
}
}
]
}