darkrockmountain / gomail

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.
https://darkrockmountain.com
Apache License 2.0
4 stars 1 forks source link

feat(email_message): encapsulate EmailMessage and Attachment struct with private fields and add constructors #16

Closed JRocabruna closed 1 month ago

JRocabruna commented 1 month ago

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.

Checklist

Please ensure the following guidelines are met:

Additional Information