BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.67k stars 1.85k forks source link

when adding users via API no invitation email gets send #4720

Closed tlederer closed 8 months ago

tlederer commented 8 months ago

Attempted Debugging

Searched GitHub Issues

Describe the Scenario

when adding users via API no invitation email gets send in the request there the parameter send_invite=1 but no email gets send when adding manually email gets send

Exact BookStack Version

v23.10.4

Log Content

No response

Hosting Environment

Docker

ssddanbrown commented 8 months ago

Hi @tlederer,

This appears to be an issue of the handling of this parameter within BookStack. If you send the data as JSON, where you can specify true for the value, this should work, but I don't think it's possible to send an invite via x-www-form-urlencoded data right now.

I've assigned this to be addressed for the next feature release.

Dev notes

Incoming data is validated as boolean castable type, but not actually cast so the send invite check fails:

https://github.com/BookStackApp/BookStack/blob/00b5dd78528bff804a502dcaa5cd43b18652e0a9/app/Users/Controllers/UserApiController.php#L93

tlederer commented 8 months ago

Perfect @ssddanbrown - just checked it. Sending the data as JSON works! You saved my day as I will need to create over 250 accounts. Thanks so much.

ssddanbrown commented 8 months ago

The core issue has now been addressed in 56d07f1909c61d40a946eb636be864ede4b00ab6, with test to cover and docs updated to note, which will be part of the next feature release.

Thanks again @tlederer for raising.