Skip to content

Unify attachment api #35

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

Merged
merged 8 commits into from
May 5, 2021
Merged

Unify attachment api #35

merged 8 commits into from
May 5, 2021

Conversation

xhit
Copy link
Owner

@xhit xhit commented Apr 26, 2021

Merge all attachment to only one Email method called Attach and use the struct File to set the attachment information.

Fix #33

xhit added 2 commits April 26, 2021 00:38
WIP to merge all attachment to only one Email method called Attach and use the struct File to set the attachment information.

For #33
Finished Unify all attachments in method Attach and using File struct
@xhit xhit marked this pull request as ready for review April 28, 2021 04:32
@xhit xhit changed the title WIP: Unify attachment api Unify attachment api Apr 28, 2021
@xhit
Copy link
Owner Author

xhit commented Apr 29, 2021

This PR is completed. I will left opened for reviews until Cinco de Mayo

@jlinnosa
Copy link
Contributor

What I meant by the "shim" was a simple layer to translate old API into new.
e.g.

func (email *Email) AddInline(file, name, mimeType string) *Email {
        return email.Attach(&File{FilePath: file, Name: name, MimeType: mimeType, Inline: true})
}

This way you don't have to have duplicate implementations and the old tests should pass.

In deprecated attach functions, use the new Attach api.

Also, maintain the same behavior in AddAttachment and AddInline checking the len of name parameter.
@xhit
Copy link
Owner Author

xhit commented Apr 29, 2021

Done.

@xhit xhit merged commit 9de009c into master May 5, 2021
@xhit xhit deleted the unify-attach branch February 26, 2022 05:09
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.

Unify attachment handling API
2 participants