refactor: channel holds delivery config only — remove AppDisplayName, AppBaseUrl
- SmtpChannelSettings: Host, Port, Username, Password, UseSsl, FromEmail, FromName only - AppDisplayName and AppBaseUrl moved to template variables (payload responsibility) - Updated ViewModel, controller Save/Edit mapping, and Edit view accordingly Ref: IT-628 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -55,8 +55,7 @@ public class AdminChannelsController : Controller
|
||||
var channel = result.Result;
|
||||
var smtp = channel.Settings as SmtpChannelSettings ?? new SmtpChannelSettings
|
||||
{
|
||||
Host = "", Username = "", Password = "",
|
||||
FromEmail = "", FromName = "", AppDisplayName = "", AppBaseUrl = ""
|
||||
Host = "", Username = "", Password = "", FromEmail = "", FromName = ""
|
||||
};
|
||||
|
||||
var vm = new EmailChannelEditViewModel
|
||||
@@ -75,9 +74,7 @@ public class AdminChannelsController : Controller
|
||||
Password = smtp.Password,
|
||||
UseSsl = smtp.UseSsl,
|
||||
FromEmail = smtp.FromEmail,
|
||||
FromName = smtp.FromName,
|
||||
AppDisplayName = smtp.AppDisplayName,
|
||||
AppBaseUrl = smtp.AppBaseUrl
|
||||
FromName = smtp.FromName
|
||||
};
|
||||
|
||||
return View(vm);
|
||||
@@ -99,9 +96,7 @@ public class AdminChannelsController : Controller
|
||||
Password = model.Password,
|
||||
UseSsl = model.UseSsl,
|
||||
FromEmail = model.FromEmail,
|
||||
FromName = model.FromName,
|
||||
AppDisplayName = model.AppDisplayName,
|
||||
AppBaseUrl = model.AppBaseUrl
|
||||
FromName = model.FromName
|
||||
};
|
||||
|
||||
if (model.IsNew)
|
||||
|
||||
-6
@@ -45,12 +45,6 @@ public class EmailChannelEditViewModel
|
||||
[Required]
|
||||
public string FromName { get; set; } = "";
|
||||
|
||||
[Required]
|
||||
public string AppDisplayName { get; set; } = "";
|
||||
|
||||
[Required]
|
||||
public string AppBaseUrl { get; set; } = "";
|
||||
|
||||
// ── Computed ───────────────────────────────────────────────────────
|
||||
public bool IsNew => Id == Guid.Empty;
|
||||
public string PageTitle => IsNew ? "Create Channel" : "Edit Channel";
|
||||
|
||||
Reference in New Issue
Block a user