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

Transactional email preview not working - Variable "entry" does not exist #328

Open
accalton opened this issue Aug 8, 2024 · 0 comments

Comments

@accalton
Copy link

accalton commented Aug 8, 2024

Description

I've set up a transactional email notification which should trigger when a new Entry is created within a specific section. However, whenever I try to send a test, preview, or view the email I receive a Twig error stating that "Variable "entry" does not exist"

It does not matter if I attempt to use the {{ entry }} or {{ object }} variable, the error that that variable does not exist is returned.

How to reproduce

  • Craft CMS Pro v4.8.9
  • Sprout Email v4.45.0
  1. Created a new Email Type (Custom Template) and provided it a template file for both HTML and txt, field layout only has the defaultMessage field
  2. Create a new Transactional Email (using the above described custom Email Type) and set it up with the event to trigger "When an entry is created", and add a rule to define the section (which is populated with enabled/published entries)
  3. Save the Transactional email
  4. Either try using "Send Test" (I'm using MailHog and system messages come through, but no message comes through using "Send Test"), "Preview" or "View" - both of these last versions just show the Twig error stating "Variable "entry" does not exist"

The custom template currently only contains the following text:

Title: {{ entry.title }}

Sprout Version

4.45.0

Craft Version

4.8.9

Database Type Version

MariaDB 10.9

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

No branches or pull requests

1 participant