How to set TO ADDRESS while sending an email in Hybris?

99封情书 提交于 2019-12-08 07:33:58

问题


When user replies on a mail that he has received that should go to particular email id. I tried to give in DefaultEmailGenerationService.java but it didn't reflect.

Could any one suggest how it can be achieved?


回答1:


Scenario 1:

How to change fromEmail Address of an email in Hybris?

As I mentioned in the comment if you want to set from emailAddress you can do that using Impex. Just find out what is your emailPage and set fromEmail and fromName.


Scenario 2:

How to set fix toAdress in Hybris for all email?

If you want to send all emails to some fix toAddress, in that case, you need to override email and displayName in respective *EmailContext of renderer template.

Let's just assume you want to override toAddress in customer registration flow. So here you need to find context class name form impex. Below are the renderer template for customer registration subject & body and CustomerEmailContext is the class name which will feed all data to this renderer.Now you just need to populate those data in init method of CustomerEmailContext.java


Scenario 3:

How to support multiple toAddress and attachments in Hybris?

To support multiple toAddress & fromAddress, ccAddresses, bccAddresses and attachments.

  • You need to create custom fields(toAddressList, ccAddresses etc) in your *EmailContext and populate the value.
  • Override generate method of DefaultEmailGenerationService class.
  • Fetch your value from emailContext like emailContext.get("yourcustomFiled")
  • Modify createEmailMessage method in such way so you can pass all your custom fields(toAddressList, ccAddresses etc) to final DefaultEmailService

You can find detail post here



来源:https://stackoverflow.com/questions/49387540/how-to-set-to-address-while-sending-an-email-in-hybris

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!