alykoshin / gmail-send

Minimalistic module to send email using GMail
MIT License
89 stars 26 forks source link

Allow file renaming #5

Open Nokel81 opened 7 years ago

Nokel81 commented 7 years ago

Allow the files option to take a object or an array of objects with the following signature:

{
    "path": "path/to/file",
    "sendAs": "realName.png"
}
alykoshin commented 7 years ago

Done in gmail-send@1.2.11, with different property name:

...
var filepath = './demo-attachment.txt';  // File to attach

send({ 
  files: [                                    // Array of files to attach
    filepath,                                 // Old behavior, attach file without any changes
    {                                         // Now you can also define file properties
      path: filepath,                   
      filename: 'filename-can-be-changed.txt' // You can override filename in the attachment if needed
    }
  ],
}, 
...
});

Please, confirm it is working.

Trebossalol commented 4 years ago

for me its not working

alykoshin commented 4 years ago

Can you provide more info: versions, code samples etc.

Trebossalol commented 4 years ago

I used latest Version, and the Sample from the npm page. But i dont need it anymore, thank you anyway 👍