diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-12-07 03:54:12 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-12-07 03:54:12 +0100 |
| commit | 1a3c7bab2ad7deae0a778eb84b6d130df1bd9d36 (patch) | |
| tree | 2528e098713f88808b9cf50a2306836b17d3add7 | |
| parent | c52feb0ffd1d9e759ef37aef8548b3d8e4f776fc (diff) | |
| download | greatoffice-1a3c7bab2ad7deae0a778eb84b6d130df1bd9d36.tar.xz greatoffice-1a3c7bab2ad7deae0a778eb84b6d130df1bd9d36.zip | |
feat: Print email when debugging
| -rw-r--r-- | code/api/src/Services/MailService.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/code/api/src/Services/MailService.cs b/code/api/src/Services/MailService.cs index 6f9ff18..4d789dd 100644 --- a/code/api/src/Services/MailService.cs +++ b/code/api/src/Services/MailService.cs @@ -41,7 +41,9 @@ public class MailService if (message.HtmlBody.IsNullOrWhiteSpace() && message.TextBody.IsNullOrWhiteSpace()) { throw new ArgumentNullException(nameof(message), "Both HtmlBody and TextBody is empty, nothing to send"); } - +#if DEBUG + _logger.LogInformation("Sending email: {0}", JsonSerializer.Serialize(message, new JsonSerializerOptions() {WriteIndented = true})); +#endif var response = await _httpClient.PostAsJsonAsync("https://api.postmarkapp.com/email", message); _logger.LogInformation("Postmark returned with message: {0}", (await response.Content.ReadFromJsonAsync<PostmarkSendResponse>()).Message); } catch (Exception e) { |
