You cannot cast while in Wild Shape. However, if you trigger Absorb Elements before your turn and then use Wild Shape before you attack during your following turn, you can absolutely use the added damage to your next melee attack, you just can’t trigger the initial cast of Absorb Elements while in Wild Shape.