github getgrav/grav-plugin-email 5.2.1

2 hours ago

Bugfix

  • A form that drops every one of its recipients no longer does it in silence. An address the plugin cannot parse is discarded, and when the to parameter produced nothing at all, buildMessage() skipped the call that sets the To header entirely — so the message left with no recipients, the form told the visitor it had been sent, and not one line was written to any log. Every discarded address is now reported to both logs/email.log and logs/grav.log, naming the parameter it came from, the value that could not be read (truncated, so a mailing list cannot fill the log) and whether anything usable was left. The report also names the cause, because in practice there is only one: a Name <address> value that has been through Twig's escape filter, written as |e or applied by autoescape, arrives as John Doe &lt;john@example.com&gt;, which is not an email address by any reading. Address parameters want |raw. Addresses that do parse are handled exactly as before, including a partial failure — those go out to whoever was left, and are logged too, since half a send is every bit as quiet as none of one. Reported by @thekenshow (grav#3905)
  • A form whose email could not be sent stops reading the mail server's refusal out to the visitor. What went on the page was the transport's own words with a stop emoji in front of them, which is written for whoever set up the mail account and not for whoever filled in the contact form — it routinely names the server, names the account, and explains precisely why the credentials were rejected, to an anonymous stranger. The transport's text now goes to the Grav log, where the site owner will actually look for it, and the visitor is shown something a site can configure: an error_message on the email action, or the new Form send failure message setting in the plugin's Email Defaults, or failing both a translated "Your message could not be sent right now. Please try again in a few minutes." With Grav's debugger switched on the transport's text is appended to it anyway, on the grounds that anybody looking at the form with the debugger running is the person configuring it. Reported by @pboguslawski (form#567)

Don't miss a new grav-plugin-email release

NewReleases is sending notifications on new releases.