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.
This pull request introduces a new feature to encapsulate the EmailMessage struct within the gomail package. The encapsulation adds functionality for setting and getting email properties while ensuring proper validation and sanitization of inputs. It also introduces two constructors, NewEmailMessage and NewFullEmailMessage, for creating instances of EmailMessage. This change enhances the modularity and maintainability of the code by providing a clear API for interacting with email messages.
Related Issue: Closes #5
Type of Change:
New feature (non-breaking change which adds functionality)
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
This change refactors the EmailMessage struct to include getter and setter methods for its properties, encapsulating the internal representation. Two constructors, NewEmailMessage and NewFullEmailMessage, have been added for creating instances of EmailMessage. Tests have been updated and added to ensure 100% coverage of the new functionality. The documentation has been updated to reflect these changes.
Feature/encapsulate email message
Description
This pull request introduces a new feature to encapsulate the
EmailMessage
struct within thegomail
package. The encapsulation adds functionality for setting and getting email properties while ensuring proper validation and sanitization of inputs. It also introduces two constructors,NewEmailMessage
andNewFullEmailMessage
, for creating instances ofEmailMessage
. This change enhances the modularity and maintainability of the code by providing a clear API for interacting with email messages.Checklist
Please ensure the following guidelines are met:
type(scope): description
.Additional Information
This change refactors the
EmailMessage
struct to include getter and setter methods for its properties, encapsulating the internal representation. Two constructors,NewEmailMessage
andNewFullEmailMessage
, have been added for creating instances ofEmailMessage
. Tests have been updated and added to ensure 100% coverage of the new functionality. The documentation has been updated to reflect these changes.