Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ await _orderService.InsertOrderNote(new OrderNote {

//send email notifications
await _messageProviderService.SendOrderPlacedStoreOwnerMessage(request.Order, request.Customer,
_languageSettings.DefaultAdminLanguageId);
_languageSettings.DefaultAdminLanguageId, request.Host);

string orderPlacedAttachmentFilePath = string.Empty, orderPlacedAttachmentFileName = string.Empty;
var orderPlacedAttachments = new List<string>();
Expand All @@ -87,14 +87,16 @@ await _pdfService.SaveOrderToBinary(request.Order, request.Order.CustomerLanguag
_logger.LogError(ex, "Error - order placed attachment file {OrderOrderNumber}", request.Order.OrderNumber);
}

await _messageProviderService.SendOrderPlacedCustomerMessage(request.Order, request.Customer, request.Order.CustomerLanguageId, orderPlacedAttachmentFilePath, orderPlacedAttachmentFileName, orderPlacedAttachments);
await _messageProviderService.SendOrderPlacedCustomerMessage(request.Order, request.Customer,
request.Order.CustomerLanguageId, orderPlacedAttachmentFilePath, orderPlacedAttachmentFileName,
orderPlacedAttachments, request.Host);

if (request.Order.OrderItems.Any(x => !string.IsNullOrEmpty(x.VendorId)))
{
var vendors = await _mediator.Send(new GetVendorsInOrderQuery { Order = request.Order });
foreach (var vendor in vendors)
await _messageProviderService.SendOrderPlacedVendorMessage(request.Order, request.Customer, vendor,
_languageSettings.DefaultAdminLanguageId);
_languageSettings.DefaultAdminLanguageId, request.Host);
}
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ await UpdatePaymentTransaction(processPayment.paymentTransaction, result.PlacedO
await _mediator.Send(new OrderNotificationCommand {
Order = result.PlacedOrder,
Customer = details.Customer,
OriginalCustomerIfImpersonated = command.OriginalCustomerIfImpersonated
OriginalCustomerIfImpersonated = command.OriginalCustomerIfImpersonated,
Host = command.Host
}, cancellationToken);

//check order status
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Grand.Domain.Customers;
using Grand.Domain.Orders;
using Grand.Domain.Stores;
using Grand.Mediator;

namespace Grand.Business.Core.Commands.Messages.Common;
Expand All @@ -17,4 +18,9 @@ public class OrderNotificationCommand : IRequest
/// Staff member who placed the order while impersonating the customer, if any
/// </summary>
public Customer OriginalCustomerIfImpersonated { get; set; }

/// <summary>
/// Host of the storefront request that placed the order; the messages link to it
/// </summary>
public DomainHost Host { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Grand.Business.Core.Utilities.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Localization;
using Grand.Domain.Messages;
using Grand.Domain.Stores;

namespace Grand.Business.Core.Interfaces.Marketing.Contacts;

Expand Down Expand Up @@ -55,23 +57,24 @@ IList<CustomAttribute> AddContactAttribute(IList<CustomAttribute> customAttribut
/// </summary>
/// <param name="language">Language</param>
/// <param name="customAttributes">Attributes </param>
/// <param name="customer">Customer</param>
/// <param name="host">Store host the file upload links point to; without one the file is named but not linked</param>
/// <param name="separator">Separator</param>
/// <param name="htmlEncode">A value indicating whether to encode (HTML) values</param>
/// <param name="allowHyperlinks">A value indicating whether to HTML hyperlink tags could be rendered (if required)</param>
/// <returns>Attributes</returns>
Task<string> FormatAttributes(
Language language,
IList<CustomAttribute> customAttributes,
Customer customer,
DomainHost host,
string separator = "<br />",
bool htmlEncode = true,
bool allowHyperlinks = true);

/// <summary>
/// Get parse contact attributes
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
Task<IList<CustomAttribute>> GetParseContactAttributes(IList<CustomAttribute> model);
/// <param name="model">Posted attributes</param>
/// <param name="access">Customer whose groups limit the attributes and the store</param>
/// <returns>Selected attributes whose conditions are met</returns>
Task<IList<CustomAttribute>> GetParseContactAttributes(IList<CustomAttribute> model, CatalogAccess access);
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Grand.Business.Core.Utilities.Catalog;
using Grand.Domain.Messages;

namespace Grand.Business.Core.Interfaces.Marketing.Contacts;
Expand All @@ -18,10 +19,9 @@ public interface IContactAttributeService
/// <summary>
/// Gets all Contact attributes
/// </summary>
/// <param name="storeId">Store identifier</param>
/// <param name="ignoreAcl">Ignore acl</param>
/// <param name="access">Customer whose groups limit the result and the store, or every attribute of the store</param>
/// <returns>Contact attributes</returns>
Task<IList<ContactAttribute>> GetAllContactAttributes(string storeId = "", bool ignoreAcl = false);
Task<IList<ContactAttribute>> GetAllContactAttributes(CatalogAccess access);

/// <summary>
/// Gets a Contact attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ namespace Grand.Business.Core.Interfaces.Marketing.Customers;

public interface ICustomerCoordinatesService
{
Task<(double longitude, double latitude)> GetGeoCoordinate();
Task<(double longitude, double latitude)> GetGeoCoordinate(Customer customer);
Task SaveGeoCoordinate(double longitude, double latitude);
Task SaveGeoCoordinate(Customer customer, double longitude, double latitude);
}
Loading
Loading