how to user mediator in plugin

Sunday, February 5, 2023 9:44:30 PM
  • Posted: Thursday, February 10, 2022 3:19 PM
  • 41
hi
i need use another way to register customer
i create plugin but when save user in database first call
bool isApproved = _customerSettings.UserRegistrationType == UserRegistrationType.Standard;
                var registrationRequest = new RegistrationRequest(_workContext.CurrentCustomer, model.Email,
                    _customerSettings.UsernamesEnabled ? model.Username : model.Email, model.Password,
                    _customerSettings.DefaultPasswordFormat, _workContext.CurrentStore.Id, isApproved);
                var registrationResult = await _customerManagerService.RegisterCustomer(registrationRequest);
                if (registrationResult.Success)

then need call
model = await _mediator.Send(new GetRegister() {
                Customer = _workContext.CurrentCustomer,
                ExcludeProperties = true,
                Language = _workContext.WorkingLanguage,
                Store = _workContext.CurrentStore,
                Model = model,
                OverrideCustomCustomerAttributes = customerAttributes
            });


for save all attributes
how can i use mediator  i can't add web for refrenc in plugin
plz help me thx
0
  • Posted: Wednesday, February 16, 2022 5:56 AM
  • 41
i add GetRegister() and Handler to plugin
from solve this

0
back to top
Filters