There's no mnemonic - it's a question of whether the [French verb needs *à*](https://www.lawlessfrench.com/grammar/verbs-with-a/). *Envoyer* and *dire* do - *envoyer quelque chose à qqun* and *dire quelque chose à qqun*, so your first two are wrong. The correct grammar is

*Je leur ai envoyé...*

*Je leur ai dit...*

But the [causative](https://www.lawlessfrench.com/grammar/faire-causative/) doesn't need a preposition: *faire qqun faire qqqchose* so *Je les avais fait...* is correct.