disable transport fallback when sending emails

393 Views Asked by At

I have two transports, one for general emails and the other for noreply emails because of huge number

mailer.yml:

framework:
    mailer:
        transports:
            main: '%env(MAILER_DSN)%'
            noreply: '%env(MAILER_DSN_NOREPLY)%'

When MAILER_DSN_NOREPLY is down, there is one try with MAILER_DSN_NOREPLY and next it sends the email with MAILER_DSN

How can I disable this rule and just try 3 times to send with MAILER_DSN_NOREPLY and then keep mail on the failed queue?

1

There are 1 best solutions below

0
On BEST ANSWER

Looking in the code of symfony/mailer, whens the transports are built, the first one founded in considered as default and will be used as fallback

so i wrote "noreply" transport on first line