Send all emails to the same email address (for test purposes)

Hi,

is there an option to send all emails to the same address. Or use the “from” address as the “to” address? This is for testing purposes only. I couldn’t find anything in the UI but maybe there is a file that I can change.

I want to migrate another billing software to InvoiceNinja and want to test things to make sure, everything is working as planned. But I don’t want to send emails to customers during this test phase.

Maybe there is a quick solution for this.

Many thanks in advance!
Gijs

Hi,

One option may be to set the mail driver to log, this will write all emails to the log file rather than send them.

1 Like

Hi @hillel

that would be a perfect solution. I don’t see this option in the settings. I tried to set

MAIL_MAILER=log

in the env file and recreated the docker container. But then the email was still received. Do I need to run some php artisan command?

Thanks a lot
Gijs

It may help to load /update?secret= to update the cached config.

Note: you can check which driver is being used in the health check in the app.

Hmm, unfortunately /update?secret=xxxxx did not change anything.

The health check still says smtp and emails are still sent. I also tried

docker exec -it [container] php artisan optimize

but that didn’t work either :frowning:

Any other idea?

@david can you please advise?

@ecomsilio

Assuming you are using our standard docker-compose file you should only need to edit the env file in the root of the dockerfiles directory

I just tested this by taking down the container, changing the MAIL_MAILER to log and then bringing up the container again.

Also just ensure your env doesn’t have the MAIL_MAILER in there twice a bit further down.

1 Like

Sorry, this is awkward. It all works as long as I make the change to the correct env File :man_facepalming: