Background: I am currently building an automation that is being implemented in our kindergarten. The kindergarten administration sends out newsletters to all parents with 2-5 file attachments (PDFs, image files, Office documents).
Recently, we introduced Mattermost as a messaging tool to streamline communication and make it more direct. Thus, I have expanded my workflow to ensure that whenever the kindergarten administration sends an email to the parent distribution list (which forwards emails to all invited parents), the message along with attachments should also be posted in a specific Mattermost channel.
Challenge: The main challenge I am facing is that the number of attachments varies, and I am using Google Drive as an intermediate storage solution to provide the files as links. However, I am struggling with retrieving the email attachments (plural) and sending all the files to the Mattermost chat. Currently, I can only send links, and even then only one link at a time. My goal is to forward all attachments from the email.
Current Workflow: The intended workflow is as follows:
Email & Attachments Retrieval:
Gmail retrieves incoming emails with the label “Kiga.”
Using a loop, I instruct the automation to save all attachments (with filenames) to Google Drive with the “Google Drive Upload” piece.
Unfortunately, this approach only works for the first attachment; additional attachments are ignored, and instead, the first attachment is duplicated multiple times on Drive.
Sending to Mattermost:
After uploading, I attempt to individually retrieve the files via the “Drive” Get Files action, so I can then send them along with the email body text to the Mattermost channel using the “Send to Mattermost” piece.
Can anyone explain me how to collect multiple files at once (I thought a loop is perfect for it…) and how send to a mattermost (or any other chat) multiple files. I just thought Drive “Read file” in a loop piece would work, but not for me).
As alternative I will also happy to get a kind of template about similar workflow.
Now I try to fetch and store the attachements inside a loop with the google drive piece. It shows “2 items” in that list… but it stores just twice the first attachement on google drive.
@kishanprmr Ah ok it works now! IT was my fault - arghh…
Another question in the same flow…
I want to fetch the files I just uploaded from Google Drive and forward them to a chat (Discord, Mattermost). Special feature: I want to send the files as files and not as url/link. Is this possible and if so, HOW?
Another idea of mine would be:
I have to cache the files on Drive on ActivePieces first, so that I can forward them as files. Can you give me some input here?
How can I send multiple files in one “post” to Discord (as attachments)?
Should I simply refer to the previous “Loop”, which pulls the files from the GoogleDrive folder? I have the problem that I can only send 1 file at a time.
Do you want to send a file in Discord or Mattermost? The Mattermost piece currently only supports the text field. Let me check their API docs and get back to you.
But in general - if I want to send bulk files at once - I need to fetch the payload of the looped piece (in that case the files in a g drive folder) or make this no sense?
@Cumonvip I checked the API docs for Mattermost. It has the functionality to provide files with messages, but there is a limit of up to 5 files per post. I will create a feature request to add file support for this action.
Hi @Cumonvip ,
Can you please guide me how you can integrate mattermost to activepieces. I have a selfhosted mattermost platform by which I used to send messages to parents. If some action occurs in an email or something, I need to send a message to the given channels.
Thanks for the reply @Cumonvip …
My use case is if an email received in a specific folder then a common message needs to sent a mattermost channel. I am successfully created the flow. But, how can I trigger the flow in activepieces, is there any webhooks for the running of the flow.?