Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding the confirmation template not working #196

Open
kevinmu17 opened this issue Oct 10, 2024 · 4 comments
Open

Overriding the confirmation template not working #196

kevinmu17 opened this issue Oct 10, 2024 · 4 comments

Comments

@kevinmu17
Copy link

When passing the message[template] the value becomes content within the email. So everyone receives template: alsfjoewiarfwejofjhewaifjewiofcontact in their mail.

Docs

I've placed my templates within the /templates/_emails folder.

Tried direct files
{{ hiddenInput('message[template]', 'contact'|hash) }}

tried folder structures
{{ hiddenInput('message[template]', 'dist/html/contact'|hash) }}

Nothing works

@kevinmu17
Copy link
Author

I've found some strange stuff here...
I've tested the message[notificationTemplate] and that worked for the default notification

So i thought, lets try message[confirmationTemplate] and voila! that did the trick. It's now displaying the new templates.

Whats strange is that in the code i could not find this parameter.
From line 170

Line 182

So, or this code is outdated and composer is installing something more new??

@rosskenney
Copy link
Contributor

Please see https://github.com/hybridinteractive/craft-contact-form-extensions/tree/v4?tab=readme-ov-file#overriding-the-confirmation-template. The main branch should be cleaned up, but the actual code comes from the branch v4 or branch v5 depending on craft version.

@kevinmu17
Copy link
Author

Ah, thanks for pointing out! i'm using v4, little confusing haha.
Another follow up question here.
These parameters are getting their way into the emails. Shouldn't this be stripped from sending?

The notification email now contains confirmationTemplate: 1643bfae7639758be6c9037252ba2f12a8e0a8da14d2ca4719fba7c03c6092f4/dist/html/contact

@rosskenney
Copy link
Contributor

Yeah, that should be adjusted. Feel free to make a separate issue for that. In the meantime you could just call out each item you want to output in the template instead of looping and outputting all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants