Closed JMKelley closed 1 year ago
I will have a look at this.
@JMKelley Is this craft 3 or 4?
Craft 4
On Tue, 13 Dec 2022, 17:30 Ross K, @.***> wrote:
@JMKelley https://github.com/JMKelley Is this craft 3 or 4?
— Reply to this email directly, view it on GitHub https://github.com/hybridinteractive/craft-contact-form-extensions/issues/167#issuecomment-1349197300, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPVLM4YMUVFWHV5DSUQLITWNCXD5ANCNFSM6AAAAAASZS7DYQ . You are receiving this because you were mentioned.Message ID: <hybridinteractive/craft-contact-form-extensions/issues/167/1349197300@ github.com>
Any luck? :)
Yeah, sorry I tested this yesterday and figured it out today.
You can't just use message as it will overwrite the array that is being built. You need to change it to something like message[message]. I just added a note about this in the readme.
Note: All of the overrides will use the message as an array and therefore if you want a message field it would be name=message[message]. If a name=message is used it will wipe out the array of overrides.
Hi @rosskenney
I' having the same issue and neither the template or subject work. Im still receiving the default template and subject from my main config (it is not overwriting it).
The formName works though.
This is my code
My email template is in templates/_emails/interest.twig
<form method="post" accept-charset="UTF-8" class="mt-12 sm:mx-auto sm:flex sm:max-w-lg form">
{{ csrfInput() }}
{{ actionInput('contact-form/send') }}
<div class="form__field_wrapper min-w-0 flex-1">
{{ input('email', 'fromEmail', submission.fromEmail ?? '', {
id: 'from-email',
autocomplete: 'email',
class: 'form__field block w-full drop-shadow-lg',
autofocus: false,
required: true,
placeholder: 'Enter your email address',
}) }}
<label for="cta-email" class="sr-only">Email address</label>
</div>
<input type="hidden" name="message[message]" value="Expression of interest">
<input type="hidden" name="message[formName]" value="Expression of interest">
<input type="hidden" name="message[template]" value="{{ 'interest'|hash }}">
<input type="hidden" name="message[subject]" value="{{ 'Thank you for your interest'|hash }}">
<input type="hidden" name="fromName" value="" />
{{ craft.contactFormExtensions.recaptcha | raw }}
<button type="submit"
class="button form-submit big-btn block w-full sm:w-fit ml-0 sm:ml-4 mt-4 sm:mt-0">{{ site.buttonLabel|default('Get started') }}</button>
</form>```
Hi @palomamtnez,
It is not message[subject]
is is just subject
to override that. If you want to override the confirmation subject it would be message[confirmationSubject]
The template overrides are as such message[notificationTemplate]
and message[confirmationTemplate]
I assume you are using Craft 4 so please take note of all changes and additions to overrides listed in the README.md file.
You're a life saviour. Thanks, that worked!
Hi, having an issue with a form where no overrides are working.
Please see the code below:
` I'm still getting the default confirmation emails as well as subjects. My templates are under `_emails/supplier.twig` Thanks