Carl Zeiss GOM Metrology Posted September 6 Posted September 6 Hi folks, I am currently preparing a migration to invision community. I want to use the REST API and tried to HTTP POST few accounts. This is working fine, but the users will get an email: "An administrator has created a new account for you at <your instance>.". How can I disable this? I do not want this message while migration, especially not while API interactions. Is there a flag to disable notifications on REST actions? Or is there a way to disable specific notifications like this user creation notification in general? I saw that I can disable SMTP with \define( 'EMAIL_DEBUG_PATH', '/dev/null' ); but that's maybe a too general restriction. Best, Robin
Solution Daniel F Posted September 6 Solution Posted September 6 You *could* wrap the constant in a condition checking the path. Something like if( $_SERVER['REQUEST_URI'] == '/api/' ) { \define( 'EMAIL_DEBUG_PATH', '/dev/null' ); } Carl Zeiss GOM Metrology 1
Carl Zeiss GOM Metrology Posted September 6 Author Posted September 6 24 minutes ago, Daniel F said: You *could* wrap the constant in a condition checking the path. Something like if( $_SERVER['REQUEST_URI'] == '/api/' ) { \define( 'EMAIL_DEBUG_PATH', '/dev/null' ); } Thank you. if(str_contains($_SERVER['REQUEST_URI'],'/api/')) { } This works nice for me. SeNioR- 1
Recommended Posts