aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--code/api/src/Services/MailService.cs4
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) {