From f6a9230d8591d830ace9461e9b440d0769335483 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Thu, 26 Jan 2023 21:42:18 +0200 Subject: [PATCH 1/4] readme update --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cfef000..e39e0e7 100644 --- a/README.md +++ b/README.md @@ -57,13 +57,25 @@ For this integration, the setup is very simple. All you need is an API Key gener } ``` -## Database -The database is SQLite. It is created automatically at the first start of the service, if it is missing. The path where the database is stored can be configured as follows: +## Logging +The logging functionality is managed with Serilog, and its configuration is done in the ```appsettings.json``` file. In addition to its standard configuration, Correo also has a preconfigured area where three destinations for logs are available: file, Postgres database and Seq. Each of the destinations can be activated or not. If logging in the console is sufficient, all additional logging destinations can be disabled. +This configuration area is: ``` -"Workspace": "workspace", -"ConnectionStrings": { - "DatabaseConnection": "Data Source={Workspace}\\correo.db" +"Logs": { + "File": { + "Enabled": false, + "Path": "logs/log.txt" + }, + "Postgres": { + "Enabled": false, + "Connection": "Host=;Port=5432;User ID=;Password=;Database=;" + }, + "Seq": { + "Enabled": false, + "Url": "", + "ApiKey": "" + } } ``` From e4130c29ba483cbad2b88f187cc4c34f492bdeb2 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sun, 29 Jan 2023 00:33:27 +0200 Subject: [PATCH 2/4] small fix --- README.md | 2 -- src/Correo.Mailgun/Extensions/ModelExtensions.cs | 2 +- src/Correo.PublishedLanguage/Commands/SendEmail.cs | 2 +- src/Correo.PublishedLanguage/Correo.PublishedLanguage.csproj | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e39e0e7..ede41fa 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,5 @@ This configuration area is: } ``` -For the moment, the only purpose of the database is to store the logs generated by Serilog. - ## Hosting The only hosting environment tested for this service is Docker, but considering that .NET 6 is cross platform, it can most likely be hosted in any environment. \ No newline at end of file diff --git a/src/Correo.Mailgun/Extensions/ModelExtensions.cs b/src/Correo.Mailgun/Extensions/ModelExtensions.cs index ca29b08..81ff4c1 100644 --- a/src/Correo.Mailgun/Extensions/ModelExtensions.cs +++ b/src/Correo.Mailgun/Extensions/ModelExtensions.cs @@ -7,7 +7,7 @@ namespace Correo.Mailgun.Extensions internal static class ModelExtensions { public static string ToMailgunAddress(this EmailMessage.MailAddress address) - => $"{address.DisplayName} <{address.Address}>"; + => string.IsNullOrEmpty(address.DisplayName) ? address.Address : $"{address.DisplayName} <{address.Address}>"; public static string ToMailgunAddresses(this IEnumerable addresses) { diff --git a/src/Correo.PublishedLanguage/Commands/SendEmail.cs b/src/Correo.PublishedLanguage/Commands/SendEmail.cs index e30bd59..91ffe27 100644 --- a/src/Correo.PublishedLanguage/Commands/SendEmail.cs +++ b/src/Correo.PublishedLanguage/Commands/SendEmail.cs @@ -13,6 +13,6 @@ namespace Correo.PublishedLanguage.Commands public IEnumerable Bcc { get; init; } public bool IsBodyHtml { get; init; } - public record MailAddress(string Address, string DisplayName); + public record MailAddress(string Address, string DisplayName = null); } } diff --git a/src/Correo.PublishedLanguage/Correo.PublishedLanguage.csproj b/src/Correo.PublishedLanguage/Correo.PublishedLanguage.csproj index 611d228..b7b27e4 100644 --- a/src/Correo.PublishedLanguage/Correo.PublishedLanguage.csproj +++ b/src/Correo.PublishedLanguage/Correo.PublishedLanguage.csproj @@ -2,7 +2,7 @@ net6.0 - 1.0.0 + 1.0.1 correo.png Correo published language From 17ec8b95d4fb1b7af0613d5528e23c8da45c4681 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sun, 29 Jan 2023 02:06:18 +0200 Subject: [PATCH 3/4] EmailMessage extension small fix --- src/Correo.Abstractions/Extensions/ModelExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Correo.Abstractions/Extensions/ModelExtensions.cs b/src/Correo.Abstractions/Extensions/ModelExtensions.cs index 1b3658d..ca52c7c 100644 --- a/src/Correo.Abstractions/Extensions/ModelExtensions.cs +++ b/src/Correo.Abstractions/Extensions/ModelExtensions.cs @@ -11,9 +11,9 @@ namespace Correo.Abstractions.Extensions public static string Log(this EmailMessage message) { var msg = $"Email sent: Subject: {message.Subject}; From: {message.From.Address}; To: {message.To.Log()};"; - if (message.Cc != null) + if (message.Cc != null && message.Cc.Any()) msg += $" Cc: {message.Cc.Log()};"; - if (message.Bcc != null) + if (message.Bcc != null && message.Bcc.Any()) msg += $" Bcc: {message.Bcc.Log()};"; return msg; } From 8e3f793e4e9577bb4d3c4c2a3e2f7b3629db4dfb Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sun, 29 Jan 2023 02:08:14 +0200 Subject: [PATCH 4/4] [1.0.1] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index db94b97..9ea45ba 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 1.0.0 + 1.0.1 Tudor Stanciu STA Correo