-
Notifications
You must be signed in to change notification settings - Fork 527
feat: Email Accounts per Store #680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
5
commits into
develop
Choose a base branch
from
copilot/add-email-functionality-per-store
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1bcb5a5
feat: Add Email Accounts per Store support
Copilot da2c886
fix: Use localized resource strings for email account UI text
Copilot 125fdda
Potential fix for pull request finding 'Generic catch clause'
KrzysztofPajak b5a3bc4
Potential fix for pull request finding 'Generic catch clause'
KrzysztofPajak d7be617
fix: Eliminate separate store cache in GetEmailAccountsByStore to pre…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Web/Grand.Web.Store/Areas/Store/Views/EmailAccount/Create.cshtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| @model EmailAccountModel | ||
| @{ | ||
| //page title | ||
| ViewBag.Title = Loc["Admin.Configuration.EmailAccounts.AddNew"]; | ||
| } | ||
| <form asp-area="@Constants.AreaStore" asp-controller="EmailAccount" asp-action="Create" method="post"> | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <div class="x_panel light form-fit"> | ||
| <div class="x_title"> | ||
| <div class="caption"> | ||
| <i class="fa fa-envelope"></i> | ||
| @Loc["Admin.Configuration.EmailAccounts.AddNew"] | ||
| <small> | ||
| <i class="fa fa-arrow-circle-left"></i> @Html.ActionLink(Loc["Admin.Configuration.EmailAccounts.BackToList"], "List") | ||
| </small> | ||
| </div> | ||
| <div class="actions"> | ||
| <button class="btn btn-success" type="submit" name="save"> | ||
| <i class="fa fa-check"></i> @Loc["Admin.Common.Save"] | ||
| </button> | ||
| <button class="btn btn-success" type="submit" name="save-continue"> | ||
| <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"] | ||
| </button> | ||
| </div> | ||
| </div> | ||
| <div class="x_content form"> | ||
| <partial name="Partials/CreateOrUpdate" model="Model"/> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </form> |
40 changes: 40 additions & 0 deletions
40
src/Web/Grand.Web.Store/Areas/Store/Views/EmailAccount/Edit.cshtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| @model EmailAccountModel | ||
| @{ | ||
| //page title | ||
| ViewBag.Title = Loc["Admin.Configuration.EmailAccounts.EditEmailAccountDetails"]; | ||
| } | ||
| <form asp-area="@Constants.AreaStore" asp-controller="EmailAccount" asp-action="Edit" method="post"> | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <div class="x_panel light form-fit"> | ||
| <div class="x_title"> | ||
| <div class="caption"> | ||
| <i class="fa fa-envelope"></i> | ||
| @Loc["Admin.Configuration.EmailAccounts.EditEmailAccountDetails"] | ||
| <small> | ||
| <i class="fa fa-arrow-circle-left"></i> @Html.ActionLink(Loc["Admin.Configuration.EmailAccounts.BackToList"], "List") | ||
| </small> | ||
| </div> | ||
| <div class="actions"> | ||
| <div class="btn-group btn-group-devided util-btn-margin-bottom-5"> | ||
| <button class="btn btn-success" type="submit" name="save"> | ||
| <i class="fa fa-check"></i> @Loc["Admin.Common.Save"] | ||
| </button> | ||
| <button class="btn btn-success" type="submit" name="save-continue"> | ||
| <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"] | ||
| </button> | ||
| <span id="emailAccount-delete" class="btn red"> | ||
| <i class="fa fa-trash-o"></i><span class="d-none d-sm-inline"> @Loc["Admin.Common.Delete"]</span> | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="x_content form"> | ||
| <partial name="Partials/CreateOrUpdate" model="Model"/> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </form> | ||
| <admin-delete-confirmation button-id="emailAccount-delete"/> |
71 changes: 71 additions & 0 deletions
71
src/Web/Grand.Web.Store/Areas/Store/Views/EmailAccount/List.cshtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| @{ | ||
| //page title | ||
| ViewBag.Title = Loc["Admin.Configuration.EmailAccounts"]; | ||
| } | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <div class="x_panel light form-fit"> | ||
| <div class="x_title"> | ||
| <div class="caption"> | ||
| <i class="fa fa-envelope"></i> | ||
| @Loc["Admin.Configuration.EmailAccounts"] | ||
| </div> | ||
| <div class="actions"> | ||
| <a href="@Url.Action("Create", new { area = Constants.AreaStore })" class="btn green"> | ||
| <i class="fa fa-plus"></i><span class="d-none d-sm-inline"> @Loc["Admin.Common.AddNew"] </span> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| <div class="x_content form"> | ||
| <div id="email-accounts-grid"></div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <script> | ||
| $(document).ready(function () { | ||
| $("#email-accounts-grid").kendoGrid({ | ||
| dataSource: { | ||
| transport: { | ||
| read: { | ||
| url: "@Html.Raw(Url.Action("List", "EmailAccount", new { area = Constants.AreaStore }))", | ||
| type: "POST", | ||
| dataType: "json", | ||
| data: addAntiForgeryToken | ||
| } | ||
| }, | ||
| schema: { | ||
| data: "Data", | ||
| total: "Total", | ||
| errors: "Errors" | ||
| }, | ||
| error: function(e) { | ||
| display_kendoui_grid_error(e); | ||
| this.cancelChanges(); | ||
| }, | ||
| serverPaging: true, | ||
| serverFiltering: true, | ||
| serverSorting: true | ||
| }, | ||
| pageable: { | ||
| refresh: true, | ||
| numeric: false, | ||
| previousNext: false, | ||
| info: false | ||
| }, | ||
| scrollable: false, | ||
| columns: [{ | ||
| field: "Email", | ||
| title: "@Loc["Admin.Configuration.EmailAccounts.Fields.Email"]", | ||
| template: '<a class="k-link" href="Edit/#=Id#">#=Email#</a>' | ||
| }, { | ||
| field: "DisplayName", | ||
| title: "@Loc["Admin.Configuration.EmailAccounts.Fields.DisplayName"]" | ||
| }, { | ||
| field: "Host", | ||
| title: "@Loc["Admin.Configuration.EmailAccounts.Fields.Host"]" | ||
| }] | ||
| }); | ||
| }); | ||
| </script> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Does MessageTemplate contain storeId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MessageTemplatedoes not have a singleStoreId— it usesLimitedToStores(bool) +Stores(list of store IDs), which is the standard GrandNode store-scoping pattern for multi-store visibility.The
storeIdinGetEmailAccountOfMessageTemplatecomes from the call site (e.g. the order-placed notification passes the order'sStoreId). It's already threaded correctly throughGetMessageTemplate(messageTemplateName, storeId)for the template lookup, and is now reused for the store-specific email account fallback.