GoMail is a powerful library for sending emails via multiple providers, including SMTP, Gmail API, Microsoft Graph API, SendGrid, AWS SES, Mailgun, Mandrill, Postmark, and SparkPost. Supporting attachments, plain text, and HTML content, it simplifies email integration for developers with easy setup and robust functionalities.
Encapsulate EmailMessage and Attachment struct with private fields and add constructors
Fixed vulnerability GO-2024-2887 from package net/netip@go1.22.3
Description
This pull request encapsulates the EmailMessage and Attachment structs by making their variables private. It adds getters and setters for these variables and implements custom MarshalJSON and UnmarshalJSON methods. Additionally, constructors for creating Attachment from a filename and content, as well as from a file path, have been added. A testdata folder is created for adding test files.
This pull request also updates the Go version to 1.22.4 to address the GO-2024-2887 vulnerability found in the net/netip package.
Related Issue: Closes #5 #15
Type of Change:
New feature (non-breaking change which adds functionality)
Security fix (non-breaking change which addresses a vulnerability)
Checklist
Please ensure the following guidelines are met:
[x] The code follows the style guidelines of this project.
[x] A self-review has been performed on the code.
[x] The code is well-documented, and comments have been added where necessary.
[x] Tests have been added to prove that the fix is effective or that the feature works. All existing tests pass.
[x] Commit messages follow the convention type(scope): description.
[x] The pull request has no conflicts with the base branch.
[x] Any dependent changes have been merged and published in downstream modules.
Additional Information
Encapsulated the EmailMessage struct by making variables private.
Added getters and setters for EmailMessage variables.
Implemented custom MarshalJSON and UnmarshalJSON methods for EmailMessage.
Encapsulated the Attachment struct by making variables private.
Added getters and setters for variables.
Implemented custom MarshalJSON and UnmarshalJSON methods for Attachment.
Added a constructor for creating Attachment from filename and content.
Added a constructor for creating Attachment from a file path.
Created a testdata folder for adding test files.
Updated Go version to 1.22.4 to address the GO-2024-2887 vulnerability in the net/netip package.
Encapsulate EmailMessage and Attachment struct with private fields and add constructors
Fixed vulnerability GO-2024-2887 from package net/netip@go1.22.3
Description
This pull request encapsulates the
EmailMessage
andAttachment
structs by making their variables private. It adds getters and setters for these variables and implements customMarshalJSON
andUnmarshalJSON
methods. Additionally, constructors for creatingAttachment
from a filename and content, as well as from a file path, have been added. Atestdata
folder is created for adding test files.This pull request also updates the Go version to 1.22.4 to address the GO-2024-2887 vulnerability found in the
net/netip
package.Checklist
Please ensure the following guidelines are met:
type(scope): description
.Additional Information
EmailMessage
struct by making variables private.EmailMessage
variables.MarshalJSON
andUnmarshalJSON
methods forEmailMessage
.Attachment
struct by making variables private.MarshalJSON
andUnmarshalJSON
methods forAttachment
.Attachment
from filename and content.Attachment
from a file path.testdata
folder for adding test files.net/netip
package.