Do not let e-mail building or sending failure result to internal server error

Created on 31 July 2024, 7 months ago

Problem/Motivation

We defined e-mail for Order paid event. In the end of the checkout, after an off-site payment gateway redirected back to the site we experienced a WSOD with displaying "Internal Server Error". The culprit was 🐛 RuntimeException: Failed to start the session because headers have already been sent by Response.php Active but in this case I think it would be better if we catched any Exception or Error during e-mail sending, log it and let the process continue. Right now, the e-mail could not be built there for whatever reasons with sessions, and the payments and order balance did not save properly. For me, the data integrity with Order and Payment entities is much more important than sending e-mails, the e-mail building/sending failure should not break the process.

Steps to reproduce

Proposed resolution

Add a try-catch block to the EmailSender::send() method.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇸🇰Slovakia kaszarobert

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024