Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Wip mail embed #1041

Merged
merged 6 commits into from
Apr 25, 2018
Merged

Wip mail embed #1041

merged 6 commits into from
Apr 25, 2018

Conversation

kteb
Copy link
Member

@kteb kteb commented Apr 21, 2018

First trial implementation for fixing the following issue: #1040

Copy link
Contributor

@robbyoconnor robbyoconnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inconsistent spelling of Embedded is bothering me a lot.

mail/message.go Outdated
@@ -32,6 +33,7 @@ type Attachment struct {
Name string
Reader io.Reader
ContentType string
Embeded bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embedded

mail/message.go Outdated
@@ -72,6 +74,19 @@ func (m *Message) AddAttachment(name, contentType string, r io.Reader) error {
Name: name,
ContentType: contentType,
Reader: r,
Embeded: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embedded

mail/message.go Outdated
m.Attachments = append(m.Attachments, Attachment{
Name: name,
Reader: r,
Embeded: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embedded

@@ -36,6 +36,8 @@ func TestSendPlain(t *testing.T) {
m.Bcc = []string{"[email protected]"}

m.AddAttachment("someFile.txt", "text/plain", bytes.NewBuffer([]byte("hello")))
m.AddAttachment("otherFile.txt", "text/plain", bytes.NewBuffer([]byte("bye")))
m.AddEmbeded("test.jpg", bytes.NewBuffer([]byte("not a real image")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addEmbedded()

Copy link
Member

@markbates markbates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kteb this looks great. We just need to fix the spelling of Embedded, which is why the tests failed. You can run grift tools:lint in the gobuffalo/buffalo root folder and it will run a bunch of linting tools on your code to make sure it passes stuff like this. :) This will be a nice feature. Thanks!

@kteb
Copy link
Member Author

kteb commented Apr 24, 2018

Is something still missing ?

@markbates markbates added this to the 0.11.1 milestone Apr 25, 2018
@markbates markbates merged commit ad4ab57 into gobuffalo:development Apr 25, 2018
@markbates
Copy link
Member

Looks great. Thanks!

stanislas-m pushed a commit that referenced this pull request May 12, 2018
* Fixed bug when attaching more thant one file

* Add AddEmbeded methods to a message

* Spelling fixes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants