Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: io.Reader as attachment #149

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

wshaman
Copy link

@wshaman wshaman commented Apr 1, 2020

Short: Add io.Reader as attachment
Motivation: Using any cloud file storage (s3 in my case) you have to

  1. read stream from storage
  2. save it to file on local disk
  3. add local file as attachment to mail (here gomail reads localfile as stream and converts to []byte)

We can reduce amount of conversions and keep code more straight-forward

@ahuret
Copy link

ahuret commented Nov 2, 2020

Nice idea, but I think it would be better to reuse the existing (appendFile) so that no dupplication here.

It means changing appendFile signature and filename would be an io.Reader (instead of string), and Attach( method would be responsible for converting filename string to io.Reader by opening the file.

What do you think ? :)

@mcbaloo
Copy link

mcbaloo commented Dec 8, 2020

@ahuret I have a file URL on a cloud server I want to attach to a mail. How do I implement this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants