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

refactor(email_sender): encapsulate EmailMessage struct #10

Closed JRocabruna closed 4 months ago

JRocabruna commented 4 months ago

Feature/encapsulate email message

Description

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.

Checklist

Please ensure the following guidelines are met:

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.