You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce the problem: Export all customers to excel in the admin area.
I need to have the clients subscribed to a store in the excel exported file. It is strange that this is present in the xml version but on the excel one.
I changed the source code by adding this function in ExportManager.cs (inside Nop.Services library):
async Task<object> getNewsLetterSubscription(Customer customer)
{
var stores = await _storeService.GetAllStoresAsync();
var subscriptions = "";
foreach(var store in stores)
{
var newsletter = await _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmailAndStoreIdAsync(customer.Email, stores.First().Id);
var subscribedToNewsletters = newsletter != null && newsletter.Active;
if(!string.IsNullOrWhiteSpace(subscriptions))
{
subscriptions += "; ";
}
subscriptions += $"{store.Name} - {subscribedToNewsletters}";
}
return subscriptions;
}
And the new property:
new PropertyByName<Customer>("NewsletterSubscription", getNewsLetterSubscription)
All stores are represented with a True False on one column instead of a separate column for each store. This is a temp fix but we should have the same behavior as the xml file. Is it possible ?
The text was updated successfully, but these errors were encountered:
Hi @AndreiMaz, @AHoxha19
I’m currently working on implementing the functionality for exporting newsletter subscription details in the customer data export. I wanted to clarify how you would like the data to be presented:
Should the newsletter subscription status be included in separate columns for each store like XML (e.g., Newsletter-Store1, Newsletter-Store2, etc.)?
Please let me know your preference, and I’ll adjust the implementation accordingly.
Looking forward to your feedback!
Hi @AHoxha19
This pull request (Add newsletter subscription data to Excel export #7488) addresses the issue by including the newsletter subscription status for each store in the Excel export of customer data.
Key changes include:
Fetching all stores using ( _storeService.GetAllStoresAsync )
Dynamically fetching the subscription data for each store using
( _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmailAndStoreIdAsync )
Adding the subscription status as a new column in the Excel export.
For further details, you can review the pull request linked above. Customers Excel report.xlsx
Please see the attached sample Excel file for a demonstration.
nopCommerce version: 4.50.1
Steps to reproduce the problem: Export all customers to excel in the admin area.
I need to have the clients subscribed to a store in the excel exported file. It is strange that this is present in the xml version but on the excel one.
I changed the source code by adding this function in ExportManager.cs (inside Nop.Services library):
And the new property:
new PropertyByName<Customer>("NewsletterSubscription", getNewsLetterSubscription)
All stores are represented with a True False on one column instead of a separate column for each store. This is a temp fix but we should have the same behavior as the xml file. Is it possible ?
The text was updated successfully, but these errors were encountered: