-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from DarkRockMountain/bugfix/update-go-1.22.4
feat(email_message): encapsulate EmailMessage and Attachment struct with private fields and add constructors
- Loading branch information
Showing
35 changed files
with
1,044 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module github.com/darkrockmountain/gomail/azure_email_sender | ||
|
||
go 1.22.1 | ||
go 1.22.4 | ||
|
||
require github.com/darkrockmountain/gomail v0.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,9 +46,7 @@ if err != nil { | |
// Define email message | ||
message := gomail.NewEmailMessage(sender,[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>"). | ||
AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,7 @@ if err != nil { | |
|
||
// Define email message using an alias email address | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,9 +84,7 @@ if err != nil { | |
|
||
// Define email message using an alias email address | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,9 +144,7 @@ if err != nil { | |
|
||
// Define email message using an alias email address | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,9 +85,7 @@ if err != nil { | |
|
||
// Define email message using an alias email address | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,9 +78,7 @@ if err != nil { | |
|
||
// Define email message using an alias email address | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,9 +42,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,9 +51,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,9 +40,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,9 +37,7 @@ if err != nil { | |
|
||
// Define email message | ||
message := gomail.NewEmailMessage("[email protected]",[]string{"[email protected]"}, "Test Email with attachment", "This is the plain text part of the email."). | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(gomail.Attachment{ | ||
Filename: "attachment.jpg", Content: attachmentContent, | ||
}) | ||
SetHTML("<p>This is the <b>HTML</b> part of the <i>email</i>.</p>").AddAttachments(*gomail.NewAttachment("attachment.jpg", attachmentContent)) | ||
|
||
// Send email | ||
if err := emailSender.SendEmail(message); err != nil { | ||
|
Oops, something went wrong.