Send Gmail with 3-4 attachments

Hello

I need help ! I am trying to trigger an email sent via gmail. I want to be able to attach 3-4 pdf files as attachments. I am having trouble. Please help someone !

1 Like

Hi @Mervin_T_Thomas

As long as the binary files are named differently, you can add them comma separated in the grmail step.

Here’s a workflow.

  • :sparkling_heart: If this helped you, click the heart to show it’s useful to others.
  • :white_check_mark: If this solved your issue, mark it as the solution to help the community.
2 Likes

Hello,

thanks for your reply. But How do you rename it as doc1,doc2. I am a noob and I am unable to figure it out. Any resource ? Also is this being downl;oaded from Google Drive ?

1 Like

You can convert your files into binary using following code in a code node (js code)

const output = [];

for (const item of items) {
  const binary = item.binary || {};

  for (const key in binary) {
    if (binary[key].data) {
      output.push({
        json: {
          fileKey: key,
          fileName: binary[key].fileName,
          fileExtension: binary[key].fileExtension
        },
        binary: {
          data: binary[key]
        }
      });
    }
  }
}

return output;

It’ll fetch previous node’s files convert it to binary and next node will be able to use it with the fixed input as data
Somehow, I coulnd’t carry forward it to different nodes (Except next to that code) but works.

Hope this helps.

1 Like

Hi @Mervin_T_Thomas

Here’s a workflow downloading from google drive, renaming the files, and sending through gmail. You rename them by adding a name to this field. “Put Output File in Field”

Does this help?

:sparkling_heart: If this helped you, click the heart to show it’s useful to others.
:white_check_mark: If this solved your issue, mark it as the solution to help the community.

thank you everyone ! I got it to work :slight_smile: THank you so much again !

1 Like

Glad to help @Mervin_T_Thomas

:heart: If any of our responses were helpful to you , make sure to click the heart so others know that they are useful responses.