2

Our current project the Sitecore has more than 3 websites under single instance .

Every website has one page named contact us, where 4 fields will be there to get the input from end user and those are like Name, Company, Phone, Message and then Submit button .

Now in the CMS client has asked to create only one single form and used that will be same component for the 3 different websites -- because all of the contact us form web page are same . The only difference is as soon as the submit button will be clicked by end user then all of 3 websites should have 3 different email body along with 3 different email webmasters recipient.

Any suggestion on this how to implement that .

1 Answer 1

1

Two options:

1) Go for a separate form per website. In the long term this will most likely prove to give the most flexibility. To facilitate creation, you could create the form once as a template and then create the different forms from this template. enter image description here

2) If you really want to reuse the same form. A custom submit action will have to be created. When doing so, you have full control of what needs to be done when the form is submitted. In this action, you can check the current website and act accordingly. When sending an email, in order to have a different html body, you will probably have to create different exm message. https://doc.sitecore.com/developers/93/sitecore-experience-manager/en/walkthrough--creating-a-custom-submit-action.html

2
  • Thanks @bart , "Go for a separate form per website"-- not possible . So we are also implementing the 2 option create the custom save action , checking at run time the host name and send the email but how to send the 3 different email to 3 different person . All the email recipient address and email body will come from cms . They want to change email body and recipient anytime .
    – D S
    Commented Jan 28, 2020 at 12:21
  • You will need separate exm messages per email body or you could create an exm message with one token in the boday and then just put the entire actual body in that one token. For different email-adresses, you will have to create different xdb contacts. Commented Jan 28, 2020 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.