diff --git a/src/Libraries/Nop.Services/ExportImport/ExportManager.cs b/src/Libraries/Nop.Services/ExportImport/ExportManager.cs index 63af773ff85..64a8cd427b1 100644 --- a/src/Libraries/Nop.Services/ExportImport/ExportManager.cs +++ b/src/Libraries/Nop.Services/ExportImport/ExportManager.cs @@ -2034,7 +2034,8 @@ async Task getStateProvince(Customer customer) return stateProvince?.Name ?? string.Empty; } - + // Fetch all stores from the service + var stores = await _storeService.GetAllStoresAsync(); //property manager var manager = new PropertyManager(new[] { @@ -2111,7 +2112,18 @@ async Task getStateProvince(Customer customer) }, !_securitySettings.AllowStoreOwnerExportImportCustomersWithHashedPassword), - }, _catalogSettings); + } + .Concat( + // Add newsletter subscription properties for each store dynamically + stores.Select(store => new PropertyByName( + $"Newsletter-in-store-{store.Id}", + async (customer, lang) => + { + var newsletter = await _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmailAndStoreIdAsync(customer.Email, store.Id); + return (newsletter != null && newsletter.Active).ToString(); + } + )) + ), _catalogSettings); //activity log await _customerActivityService.InsertActivityAsync("ExportCustomers",