on 04-20-2016 9:31 AM
By default, B2B Site using the uid of Customer while generating the order confirmation email. But I want to Use customer email to send the order confirmation.
Hello , This we can resolve from the code In DefaultCustomerEmailResolutionService this class hybris people are verifying the customer uid as email address in the method validateAndProcessEmailForCustomer . they are considering the customer Uid as Email address . So in the catch block you can check again whether the user has any email address either from his addresses or from currentUser and return it if the uid is not equal to Email addresss. like below.
email = customerModel.getAddresses().iterator().next().getEmail(); if (StringUtils.isBlank(email)) { final B2BCustomerModel b2BCustomerModel = (B2BCustomerModel) userService.getCurrentUser(); email = b2BCustomerModel.getEmail(); } if (StringUtils.isNotBlank(email)) { LOG.info("Found one Email Address for Customer :: " + email); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I think from OOTB the order confirmation email should be sent using user(customer)'s email .
As you can see from "b2bapprovalprocess-spring.xml", the bean:
<bean id="informOfOrderApproval"
class="de.hybris.platform.b2b.process.approval.actions.InformOfOrderApproval"
parent="abstractProceduralB2BOrderApproveAction">
<property name="fromAddress" value="b2b@hybris.com"/>
<property name="b2bEmailService" ref="b2bEmailService"/>
</bean>
In "b2bEmailService(DefaultB2BEmailService)", the method "createOrderApprovalEmail()" is to create this kind of email. And for the email's recipient, it is like this:
email.addTo(user.getEmail());
However, you can implement your own emailService bean in the "informOfOrderApproval", by extending "DefaultB2BEmailService", and override "createOrderApprovalEmail()" to make sure the email is sent to the customer's email address.
Hopefully this could help you a little bit.
Thanks & Regards,
Hongxian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.