The guest's lock code can be added to a message rule as a message tag. From the “Insert tags” drop-down menu below the message box you can choose the "Guest's Lock Code" tag.
This will automatically fill in the guest's code for that specific reservation.
Most people include the code as part of their check-in instructions for the guest, like in the example below:
KEY:
There is a keypad attached to the front door. Your access code is {{Guest Lock Code}}, followed by the checkmark on the keypad. Please note that this code is not active until your scheduled check-in time. To lock the door when you leave just press any number. If you have any trouble with the code please message us, if it's past 10 pm and it's an emergency, please call me twice and it will ring my phone.