- πΊπΈUnited States greggles Denver, Colorado, USA
This solution seems reasonable to me. Thanks for identifying this problem and suggesting the solution.
- First commit to issue fork.
- Status changed to Needs work
over 1 year ago 8:23pm 22 February 2023 - πΊπΈUnited States rymcveigh
I'm marking this as needing work and creating a new merge request because the current patch can not be applied to the 8.x-2.x branch.
- @rymcveigh opened merge request.
- πΊπΈUnited States rymcveigh
I moved your changes into an MR and based it off of the 8.x-2.x branch so it should be mergeable. I'm confused why we need the extra catch with the log. It looks like most (if not all) of the exceptions are logged in the original
::mail()
function. Is there an exception that isn't covered? If so, would it be better to adjust the original function rather than add a new function to the code base? - πΊπΈUnited States lkacenja
I looked this over and presume that the reason for creating a "doMail" method was to facilitate easy wrapping of the rather lengthy business logic that was formerly in the "mail" method. We do want to make sure we catch all the SendgridExceptions raised in that code. Creating a new method prevents the "mail" method from taking up extra horizontal space, but I do see the virtue in not adding new methods willy-nilly. I think either creating a new function (as authored) or wrapping all the contents of the original mail method and not creating a new function are both fine.
In my opinion, if a "doMail" method is added it should be protected. Otherwise, the intention of the original interface is violated.
- Status changed to Needs review
over 1 year ago 3:27pm 23 February 2023 - πΊπΈUnited States rymcveigh
I adjusted the doMail function to be protected in commit 10ca0226.
-
Perignon β
committed 08672829 on 8.x-2.x authored by
rymcveigh β
Issue #3310167: Improperly implemented interface \Drupal\Core\Mail\...
-
Perignon β
committed 08672829 on 8.x-2.x authored by
rymcveigh β
- Status changed to Fixed
over 1 year ago 1:11am 24 February 2023 - πΊπΈUnited States Perignon
PR merged.
Thanks for the help and contribution
Automatically closed - issue fixed for 2 weeks with no activity.