$$\oint_{C}\frac{e^z}{(z-i)^2(z+2)}dz\,\,\,\,\,\,\,\,C:|z-i|=2$$
My try:
Let's denote $f(z):=\frac{e^z}{(z+2)}$ Applying Cauchy's integral formula: $$=\oint_{C}\frac{\frac{e^z}{(z+2)}dz}{(z-i)^2}=f'(i)2\pi\cdot i=\boxed{\frac{e^i(1+i)}{(i+2)^2}\cdot 2\pi i}$$
I'm not sure if my attempt is correct or not.
It is correct. You can even use the residue theorem. The only singularity inside C is $z = i$. The residue at that point is \begin{equation} \frac{i + 1}{(i + 2)^2}e^{i} \end{equation} The integral, therefore, evaluates to \begin{equation} 2\pi i\frac{i + 1}{(i + 2)^2}e^{i} \end{equation}