Writing an entry notice that holds up

Entering an occupied unit is where well-meaning landlords get into trouble. The repair is legitimate, the intention is good, and the notice is a text message sent an hour beforehand. State requirements ask for more than that.
Give reasonable notice
Reasonable notice generally means at least 24 hours ahead, at a reasonable time of day, unless there is a genuine emergency such as a burst pipe or a gas smell. "I was in the neighborhood" is not an emergency.
State the reason
Name the purpose: inspection, repair, contractor access, showing to a prospective tenant. A notice with no stated purpose invites a refusal you cannot easily answer.
Document the delivery
Whatever channel you use, keep proof it went out and when. A dated notice with a delivery record turns a he-said-she-said dispute into a closed question.
Respect a reasonable objection
If the tenant asks to move the visit by a day for a legitimate reason, accommodate it and re-notice. The goodwill is worth more than the schedule, and repeated entry over objection is the pattern that becomes a claim.