getgrav / grav-plugin-email

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

Fix email name check #175

Closed Karmalakas closed 1 year ago

Karmalakas commented 1 year ago

Without this check, it causes a Critical Grav error (which should be just a warning IMO) of undefined index and prevents whole form email action process. Usually name is not required and often not known. In my specific case, it was with the bcc config and undefined index was bcc_name

rhukster commented 1 year ago

Fixed this another way.. cheers.

Karmalakas commented 1 year ago

Would you mind sharing a link to the change? In any case, having just $var['index'] checks anywhere isn't the best practice. There should always be empty() or isset() in similar cases. Also, I don't understand why a simple warning would be a critical error 😕

rhukster commented 1 year ago

https://github.com/getgrav/grav-plugin-email/blob/develop/classes/Email.php#L271

restructured the function too to make it a bit more readible.