Envoyer par SMS: Optimal control for quantum detectors