Version 3.0.371

This commit is contained in:
Anja 2023-08-31 12:31:38 +02:00
parent bdb2dec1c1
commit 6d22dbf40b
145 changed files with 2289 additions and 764 deletions

View file

@ -5,6 +5,7 @@ using System.Threading.Tasks;
using System.Windows.Input;
using Plugin.Messaging;
using Serilog;
using TINK.Model;
using TINK.Model.Stations;
using TINK.Model.Stations.StationNS;
using TINK.MultilingualResources;
@ -31,6 +32,9 @@ namespace TINK.ViewModel.Info
/// <summary> Holds the name of the app (sharee.bike, Mein konrad, ...)</summary>
string AppFlavorName { get; }
/// <summary> Reference on the tink app instance. </summary>
private ITinkApp TinkApp { get; }
/// <summary> Holds a reference to the external trigger service. </summary>
private Action OpenUrlInExternalBrowser { get; }
@ -45,6 +49,7 @@ namespace TINK.ViewModel.Info
/// <param name="viewService">View service to notify user.</param>
public ContactPageViewModel(
string appFlavorName,
ITinkApp tinkApp,
Func<string> createAttachment,
Action openUrlInExternalBrowser,
IViewService viewService)
@ -53,6 +58,9 @@ namespace TINK.ViewModel.Info
? appFlavorName
: throw new ArgumentException("Can not instantiate contact page view model- object. No app name centered.");
TinkApp = tinkApp
?? throw new ArgumentException("Can not instantiate settings page view model- object. No tink app object available.");
CreateAttachment = createAttachment
?? throw new ArgumentException("Can not instantiate contact page view model- object. No create attachment provider available.");
@ -141,7 +149,8 @@ namespace TINK.ViewModel.Info
Cc = APPSUPPORTMAILADDRESS.ToUpper() != MailAddressText.ToUpper() // do not sent copy if same mail address
&& MailAddressText != "konrad@sharee.bike" // do not sent copy if Mein konrad
? new List<string> { APPSUPPORTMAILADDRESS } : new List<string>(),
Subject = string.Format(AppResources.SupportmailSubjectOperatormail, AppFlavorName, SelectedStation?.Id)
Subject = string.Format(AppResources.SupportmailSubjectOperatormail, AppFlavorName, SelectedStation?.Id),
Body = TinkApp.ActiveUser.Mail != null ? $"{AppResources.SupportmailBodyText}\r\n\r\n\r\n\r\n{string.Format(AppResources.MarkingLoggedInStateInfoLoggedIn, TinkApp.ActiveUser.Mail)}" : $"{AppResources.SupportmailBodyText}\r\n\r\n\r\n\r\n{string.Format(AppResources.SupportmailBodyNotLoggedIn)}"
});
return;
@ -172,7 +181,8 @@ namespace TINK.ViewModel.Info
var message = new EmailMessage
{
To = new List<string> { APPSUPPORTMAILADDRESS },
Subject = SelectedStation?.Id != null ? string.Format(AppResources.SupportmailSubjectAppmailWithStation, AppFlavorName, SelectedStation?.Id) : string.Format(AppResources.SupportmailSubjectAppmail, AppFlavorName)
Subject = SelectedStation?.Id != null ? string.Format(AppResources.SupportmailSubjectAppmailWithStation, AppFlavorName, SelectedStation?.Id) : string.Format(AppResources.SupportmailSubjectAppmail, AppFlavorName),
Body = TinkApp.ActiveUser.Mail != null ? $"{AppResources.SupportmailBodyText}\r\n\r\n\r\n\r\n{string.Format(AppResources.MarkingLoggedInStateInfoLoggedIn, TinkApp.ActiveUser.Mail)}" : $"{AppResources.SupportmailBodyText}\r\n\r\n\r\n\r\n{string.Format(AppResources.SupportmailBodyNotLoggedIn)}"
};
// Send with attachment.