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

Submissions not working Craft 4 upgrade #124

Open
clarknelson opened this issue Mar 14, 2024 · 2 comments
Open

Submissions not working Craft 4 upgrade #124

clarknelson opened this issue Mar 14, 2024 · 2 comments
Assignees
Labels
issue Something isn't working correctly

Comments

@clarknelson
Copy link

Describe the bug or issue you're experiencing

I upgraded craft and express forms to the latest versions, now my contact form won't track submissions.

Everything looks okay on the front-end, I double checked that everything matched the recommended syntax in the docs. The only thing is when I go to submissions theres nothing there. I tried duplicating the form as well but no luck at all. Any ideas where to turn? No console messages, etc.

Craft & Plugin Info (please complete the following information):

  • Craft Version: 4.8.2
  • Express Forms Version: 2.0.3
  • Express Forms Edition: Lite
  • Fresh Install or Upgrade: Upgrade

Additional context

I can email database / logs if needed.

Thank you!

@clarknelson clarknelson added the issue Something isn't working correctly label Mar 14, 2024
@kjmartens
Copy link
Contributor

Hi @clarknelson,

What do you mean by "won't track submissions"? Won't save the submission data to the database, or won't send email notifications? 🙂

What does your email notification template look like? If you're using the old way of grabbing the system email address and name, you'll need to update that to use the projectConfig approach instead:

fromName: '{{ craft.app.projectConfig.get("email.fromName") }}'
fromEmail: '{{ craft.app.projectConfig.get("email.fromEmail") }}'

@kjmartens kjmartens self-assigned this Mar 15, 2024
@clarknelson
Copy link
Author

This is what the current notification template looks like:

CleanShot 2024-03-16 at 22 35 36@2x

I tried to update to the suggested syntax but there's still no submissions appearing in the dashboard:

CleanShot 2024-03-16 at 22 39 40@2x

Here's the whole form if you think there might be a syntax issue:


		{% if form.submittedSuccessfully %}
			<div class="success message">Thanks for getting in touch!</div>
		{% endif %}

		{% if not form.valid %}
			<div class="failure message">
				Sorry, there was an error.
				{% if form.errors|length %}
					<ul>
						{% for error in form.errors %}
							<li>{{ error|t }}</li>
						{% endfor %}
					</ul>
				{% endif %}
			</div>
		{% endif %}

		{{ form.openTag({
			attributes: {
				id: 'ajax-form',
			},
            return: '/#contact-form',
            template: '_notifications/admin.twig'
        }) }}

		<div class="row">
			<input type="text" name="firstName" placeholder="First Name*" value="{{ form.fields.firstName.value }}" required/>
			{{ forms.renderErrors(form.fields.firstName) }}
			<input type="text" name="lastName" placeholder="Last Name*" value="{{ form.fields.lastName.value }}" required/>
			{{ forms.renderErrors(form.fields.lastName) }}
		</div>
		<input type="email" name="email" placeholder="E-mail*" value="{{ form.fields.email.value }}" required/>
		{{ forms.renderErrors(form.fields.email) }}
		<input type="text" name="subject" placeholder="Subject*" value="{{ form.fields.subject.value }}" required/>
		{{ forms.renderErrors(form.fields.subject) }}
		<textarea type="text" name="message" placeholder="I dream of marshmallows..." rows="5">{{ form.fields.message.value }}</textarea>
		{{ forms.renderErrors(form.fields.message) }}
		{# {{ form.recaptcha.render }} #}

		{# {{ forms.renderErrors(form.recaptcha) }} #}
		<button class="button submit" type="submit">Submit</button>

		{# Form Contents #}
		{{ form.closeTag }}

		{% include "includes/_formAjax" %}
		```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue Something isn't working correctly
Development

No branches or pull requests

2 participants