hybridinteractive / craft-contact-form-extensions

Adds extensions to the Craft CMS contact form plugin.
MIT License
42 stars 35 forks source link

Overrides not working in form #158

Closed springboynick closed 1 year ago

springboynick commented 2 years ago

Good evening.

Im not sure if im missing something obvious, but apart from the toEmail override, I cannot get any in form overrides to be affective.

here is my code

`{% macro errorList(errors) %} {% if errors %} {{ ul(errors, {class: 'errors'}) }} {% endif %} {% endmacro %}

{% set submission = submission ?? null %}

{{ csrfInput() }} {{ actionInput('contact-form/send') }} {{ redirectInput('thank-you-for-your-images') }}

{{ input('text', 'fromName', submission.fromName ?? '', { id: 'from-name', autocomplete: 'name', }) }} {{ submission ? _self.errorList(submission.getErrors('fromName')) }}

{{ input('email', 'fromEmail', submission.fromEmail ?? '', { id: 'from-email', autocomplete: 'email', }) }} {{ submission ? _self.errorList(submission.getErrors('fromEmail')) }}

{{ tag('textarea', { text: submission.message ?? '', id: 'message', name: 'message', rows: 10, cols: 40, }) }} {{ submission ? _self.errorList(submission.getErrors('message')) }} {{ craft.contactFormExtensions.recaptcha | raw }}
` In this example, neither the subject or alternative template is picked up any help would be greatly appreciated
rosskenney commented 2 years ago

Hi, in this code I am not seeing an override used from this plugin. Just know that if you want to use a message input by itself you should use it as message[message] as the overrides piggyback off the message array. Example name="message[template]".

rosskenney commented 1 year ago

Closing this unless there is more information. Again please make sure to not just used name="message" as the other overrides use that array.