Skip to content
Snippets Groups Projects
Commit 0474eb2b authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add version information in email footer.

Fixes #31
parent c2923e37
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,8 @@ namespace ATxService ...@@ -29,6 +29,8 @@ namespace ATxService
private const string LogFormatDefault = @"${date:format=yyyy-MM-dd HH\:mm\:ss} [${level}] ${message}"; private const string LogFormatDefault = @"${date:format=yyyy-MM-dd HH\:mm\:ss} [${level}] ${message}";
// private const string LogFormatDefault = @"${date:format=yyyy-MM-dd HH\:mm\:ss} [${level}] (${logger}) ${message}" // private const string LogFormatDefault = @"${date:format=yyyy-MM-dd HH\:mm\:ss} [${level}] (${logger}) ${message}"
private static string _versionSummary;
private readonly List<string> _transferredFiles = new List<string>(); private readonly List<string> _transferredFiles = new List<string>();
/// <summary> /// <summary>
...@@ -377,6 +379,10 @@ namespace ATxService ...@@ -377,6 +379,10 @@ namespace ATxService
Log.Info("RoboSharp version: [{0}]", roboAssembly.GetName().Version); Log.Info("RoboSharp version: [{0}]", roboAssembly.GetName().Version);
Log.Info("Robosharp product version: [{0}]", roboVersionInfo.ProductVersion); Log.Info("Robosharp product version: [{0}]", roboVersionInfo.ProductVersion);
Log.Info("=".PadLeft(80, '=')); Log.Info("=".PadLeft(80, '='));
_versionSummary = $"AutoTx {buildCommitName} {buildTimestamp} | " +
$"RoboSharp {roboAssembly.GetName().Version} " +
$"{roboVersionInfo.ProductVersion}";
} }
/// <summary> /// <summary>
......
...@@ -18,6 +18,7 @@ namespace ATxService ...@@ -18,6 +18,7 @@ namespace ATxService
/// <param name="body">The email body.</param> /// <param name="body">The email body.</param>
private void SendEmail(string recipient, string subject, string body) { private void SendEmail(string recipient, string subject, string body) {
subject = _config.EmailPrefix + subject; subject = _config.EmailPrefix + subject;
body += $"\n\n--\n[{_versionSummary}]";
if (string.IsNullOrEmpty(_config.SmtpHost)) { if (string.IsNullOrEmpty(_config.SmtpHost)) {
Log.Debug("SendEmail: {0}\n{1}", subject, body); Log.Debug("SendEmail: {0}\n{1}", subject, body);
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment