mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 05:40:50 +01:00
Rename WithContentID to WithFileContentID
In the eml.go and file.go files, the function WithContentID has been renamed to WithFileContentID. This aligns more accurately with the function purpose, which is to set the content ID for a File object.
This commit is contained in:
parent
ca201b1548
commit
4e7082a540
2 changed files with 3 additions and 3 deletions
2
eml.go
2
eml.go
|
@ -405,7 +405,7 @@ func parseEMLAttachmentEmbed(contentDisposition []string, multiPart *multipart.P
|
||||||
}
|
}
|
||||||
case "inline":
|
case "inline":
|
||||||
if contentID, _ := parseMultiPartHeader(multiPart.Header.Get(HeaderContentID.String())); contentID != "" {
|
if contentID, _ := parseMultiPartHeader(multiPart.Header.Get(HeaderContentID.String())); contentID != "" {
|
||||||
if err := msg.EmbedReader(filename, dataReader, WithContentID(contentID)); err != nil {
|
if err := msg.EmbedReader(filename, dataReader, WithFileContentID(contentID)); err != nil {
|
||||||
return fmt.Errorf("failed to embed multipart body: %w", err)
|
return fmt.Errorf("failed to embed multipart body: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
4
file.go
4
file.go
|
@ -22,8 +22,8 @@ type File struct {
|
||||||
Writer func(w io.Writer) (int64, error)
|
Writer func(w io.Writer) (int64, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithContentID sets the Content-ID header for the File
|
// WithFileContentID sets the Content-ID header for the File
|
||||||
func WithContentID(id string) FileOption {
|
func WithFileContentID(id string) FileOption {
|
||||||
return func(f *File) {
|
return func(f *File) {
|
||||||
f.Header.Set(HeaderContentID.String(), id)
|
f.Header.Set(HeaderContentID.String(), id)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue