Mannich prepares 3-aminocarbonyls from primary or secondary amines, methane, and an enolizable carbonyl. Let's see an example:

reaccion-mannich
The Mannich mechanism takes place in the following steps:
Step 1 . Formation of the immonium cation
reaccion-mannich
Step 2. Enolization of the carbonyl
reaccion-mannich
Step 3. Condensation of the enol with the immonium cation
reaccion-mannich
Step 4. Hydrochloride formation
reaccion-mannich
Step 5. Neutralization of the acid medium
reaccion-mannich