Add middleware before sending any email

Hello everyone,
is mautic has the ability to write a middleware before sending any email?

I need to check something before sending email, if everything are ok, mautic can send email, otherwise it’s need to be rejected.

I reviewd the documentation and I think I can do it with EXTENDING CAMPAIGNS but I’m not sure

thanks