-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
* new plain text body * update version
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace Coravel.Mailer.Mail; | ||
|
||
public class MessageBody | ||
{ | ||
public string Html { get; set; } | ||
public string Text { get; set; } | ||
|
||
public MessageBody(string? html, string? text) | ||
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_8
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_8
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_8
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_8
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_7
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_7
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_7
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_7
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_6
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_6
Check warning on line 8 in Src/Coravel.Mailer/Mail/MessageBody.cs GitHub Actions / build_and_tests_on_dotnet_6
|
||
{ | ||
if(html is null && text is null) | ||
{ | ||
throw new System.ArgumentException("You need to supply either an HTML or plain text message - or both."); | ||
} | ||
|
||
this.Html = html; | ||
this.Text = text; | ||
} | ||
|
||
public bool HasHtmlMessage() => this.Html != null; | ||
|
||
public bool HasPlainTextMessage() => this.Text != null; | ||
} |