Template ownership changes the answer before an API client enters the picture: a developer tool sending generated reports needs an explicit owner for the attachment and its surrounding email, while login verification needs a separate owner for the code lifecycle. Short answer: keep report rendering under application control, use a dedicated SMS OTP endpoint for 2FA login, and reserve direct SMS send for notices that do not verify identity. An appointment report is content; the code used to authenticate its recipient is a credential.
Keep ownership explicit.
Consider a hypothetical production review, rather than a reported incident. If I were reviewing a developer tool that generates public sector appointment reports and emails them as attachments, I would ask what happens when the report succeeds but the recipient requests another login code. Does that request regenerate the attachment, resend the report, or change its template? It shouldn't.…