I’m a total newby and looking for a way to automatically load and store my mails recieved in gmail and icloud onto my local NAS (nextcloud).
The next step should be to save the mails regarding their recieved dates into folders and subfolders like Year/month.
I searched for this in the community but couldn’t find a way to do that.
Does anybody did this before or is there a HowTo?
Assuming you have the Gmail trigger working and/or iCloud (IMAP) trigger, if you just want to store things as they are emitted from those nodes, as JSON, you could use a Convert to File node to convert the JSON to a file, and then either a Write File to Disk node (combined with a persistent connection to an SMB share) or an FTP/SFTP node, combined with a corresponding service on the NAS.
Creating folders by date and formulating a distinct filename should be possible with expressions that use the JS Date class like {{ new Date($json.internalDate.toNumber()).toDateTime().year }}
If you wanted to store the email in some common format like eml, you might need to add a library to support that, and use a Code node to fetch and convert the email content instead.
Hi hubschrauber,
thanks for your response.
Yes, the gmail trigger is working (start simple).
I fetched the html part from the mail. Now I need to convert it to pdf. For that I set up Gotenberg with docker locally but I won’t work.
My idea was to created a pdf and write this file to disk. The folder creation can be done by the command node hopefully.
So currently the settings for the Gotenberg node are mystic to me.
Haven’t tried gotenberg before. I thought there was a way to use google docs to upload/import html and export as pdf (since you already have google/gmail connected). According to this older thread, that, and another node for APITemplate.io might be viable alternatives.