I'm looking for a way to be able to add a Dropdown (select) to the Contact Page and use it as a Subject later on in the email.
I've tried simply adding a dropdown but it doesn't seem to be working:
this is what I've tried in form.phtml
<div class="field subject required">
<div class="control">
<select id="subject" data-validate="{required:true}"/>
<option value="Subject" disabled>Subject</option>
<option value="volvo">Volvo</option>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</div>
</div>
and this is the Email Templates
{{trans "Subject: %subject" subject=$data.subject}}
Best Answer
I had the same issue, the dropdown value cannot be passed to email template, but the input type do.
I use js to pass the value to input and make it working. It is not perfect but it is working. would like to know better solution.
in
Magento_Contact/templates/form.phtml
.Then in email template