getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

Occasional silent failure when Grav caching enabled #135

Closed dustinkerstein closed 4 years ago

dustinkerstein commented 4 years ago

I've been noticing occasional silent failures (ie. the page just refreshes on submitting the form, no email is sent, and nothing gets logged when email debugging is enabled) and I believe I have isolated it to when Grav caching is enabled (cache.enabled=true in system.yaml). I'm using the 3.0.8 version of the plugin on Grav v1.6.25

My system.yaml looks like (note caching is disabled as a workaround):

home:
  alias: '/home'

pages:
  theme: landio
  process:
    markdown: true
    twig: false
  markdown:
    extra: true

cache:
  enabled: false
  check:
    method: file
  driver: auto
  prefix: 'g'

twig:
  cache: true
  debug: true
  auto_reload: true
  autoescape: false

assets:
  css_pipeline: true
  css_minify: true
  css_rewrite: true
  js_pipeline: true
  js_minify: true
  enable_asset_timestamp: true

debugger:
  enabled: false
  twig: false
  shutdown:
    close_connection: true

And my email.yaml looks like:

enabled: true
from: XYZ
to: XYZ
mailer:
  engine: smtp
  smtp:
    server: smtp.mailgun.org
    port: 587
    encryption: tls
    user: XYZ
    password: XYZ
  sendmail:
    bin: '/usr/sbin/sendmail -bs'
content_type: text/html
debug: false

Has anyone else seen this issue before?

ricardo118 commented 4 years ago

@dustinkerstein you should have cache_enabled: false in the header of any page with a form

dustinkerstein commented 4 years ago

Thanks! I searched this repo but didn't see any relevant cache references, but I should have looked into the form plugin. Sorry about that. Here is a good resource in case anyone stumbles across this in the future - https://github.com/getgrav/grav-plugin-form/issues/153