Sending attempts, template maintenance, and retained diagnostic evidence all belong in the cost model for SMS OTP resends. For a healthtech service that sends an order receipt after payment settles, the proposed optimization is to keep one immutable template reference per logical message, with smaller records for its attempts, instead of retaining another rendered message on every retry.
Short answer: give the Node.js resend API a durable idempotency record, distinguish a rejected submission from an unknown submission outcome, and assign template ownership before deciding what evidence to retain. Keep authentication challenges separate from settled-payment receipts. A resend must neither create another receipt nor silently adopt a newly edited template.
Count retained bodies before choosing the retry policy
Consider a sizing example, not a production measurement: one logical notification has 3 attempts, its rendered body occupies B bytes, and each attempt's diagnostic fields occupy M bytes.…