mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-22 10:40:39 +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":
|
||||
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 nil
|
||||
|
|
4
file.go
4
file.go
|
@ -22,8 +22,8 @@ type File struct {
|
|||
Writer func(w io.Writer) (int64, error)
|
||||
}
|
||||
|
||||
// WithContentID sets the Content-ID header for the File
|
||||
func WithContentID(id string) FileOption {
|
||||
// WithFileContentID sets the Content-ID header for the File
|
||||
func WithFileContentID(id string) FileOption {
|
||||
return func(f *File) {
|
||||
f.Header.Set(HeaderContentID.String(), id)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue