I am created a new contact form using the custom module, how do i integrate with my custom module form details into email templates.
2 Answers
Create contact_index_index.xml in your custom module layout folder with below code
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<referenceBlock name="contactForm">
<action method="setTemplate">
<argument name="template" xsi:type="string">Vendor_Module::your_custom_template_name.phtml</argument>
</action>
</referenceBlock>
</page>
-
-
-
Not getting you, you just asked how to set custom template for default contact form block and above code did it. Mar 18, 2021 at 7:44
-
I am created a contact form using custom module, how to update this as my default contact form aslo update in email template– zusMar 18, 2021 at 7:47
This is the way if you want to replace contact us page
Go to admin and create a page under Contant-> Pages-> Add new page
Then checkurl of this page in Search Engine Optimization.
Then you have to simply change the url of contact us button
In the admin menu go to Marketing -> URL Rewrites.
Click the Add URL rewrite button.
Select the "Custom" URL rewrite type
Select the store for which you want to create the custom url (which will replace "contact")
In the requested path field type your new custom contact url (e.g. contact-us)
In the target path field type the current contact url (contact)
Clear the cache and you're done
Change url for every store and its done
-
How to update in contact us email template also. after fill this form then it should be go to mail right?– zusMar 18, 2021 at 8:09
-