Hello,
we had MRBS in use years ago and now shortly again. It has developed very positively and has good functions in addition to the beautiful layout. Many thanks for this.
I could already adapt a lot to our needs. however, I fail at one thing. I would like to have mrbs write reminder mails to cancel bookings that are no longer needed and to save costs. I have found a promising approach from 2010
Here, a cron-based PHP script is used to query the database and send a mail to the booker. But due to the use of the LDAP connection and the therefore probably empty mrbs_user or mrbs_participants databases, I can't pursue the solution any further. Is it normal that the databases remain empty with ldap query?
A possible solution would be to store the email from the ldap query and then try the cron script again. I still wanted to try this, can someone here give me a hint how i could implement it or tell me if I am going in the wrong direction?
My question therefore can you fill the databases with the ldap users or is such a reminder function planned for the future?
I am grateful for any suggestion.
Thanks a lot
The mrbs_user table is empty when you are using LDAP because all the user data is stored on the LDAP server. However, given a username you can get the user's details by calling
auth()->getUser($username)
. This will return aUser
object with anemail
property.Thank you for the answer and the information. I will see what I can implement and then get back to you.
Last edit: Dennis ET 2023-05-11
I've tried a few things, but somehow I still can't find the solution, which is probably quite simple. the most promising approach is to read out the details as described by you with
auth()->getUser($username)
orsession()->getCurrentUser ($username)
. I would now like to fill the newly created custom field email_ldap with the content[email]
from the arrayuser
in the file edit_entry.php and enter it directly in a booking. However, I do not get the transfer, can you please give me here again a hint?Thanks a lot, regards
Last edit: Campbell Morrison 2023-05-26
session()->getCurrentUser()
doesn't take a parameter: it just returns the User object for the current user. Bothsession()->getCurrentUser()
andauth()->getUser($username)
return objects rather than arrays, so you'll need to access the email address as a property rather than array. For example