Hint and outline of evaluation:
Let$$\Phi (z)=\frac{1}{z^2}\left(e^{i(t+2)z}-e^{2itz}+e^{i(t-2)z}\right).$$
Prop.$1$.$$\lim_{ R\to \infty} \int_{C_R^+}\frac{e^{i\alpha z}}{z^2}dz=0\,\, \text{when} \,\,\alpha >0$$
where $C_R^+$ is the upper semi-circle radius $R$.$$\lim_{ R\to \infty} \int_{C_R^-}\frac{e^{i\beta z}}{z^2}dz=0\,\, \text{when} \,\,\beta <0$$
where $C_R^-$ is the lower semi-circle radius $R\,\,$ (oriented clockwise).
Prop.$2$.$$\lim_{ \epsilon\to 0} \int_{C_\epsilon} \Phi(z) dz=0$$
where $ {C_\epsilon} $:$\, z=\epsilon e^{i\theta }, \pi\le \theta \le 2\pi$.
For $t$ with $0<t<2$, take $$\varphi (z)=\frac{1}{z^2}\left(e^{i(t+2)z}-e^{2itz}\right) \,\,\text{and}\,\, \,
\phi(z)=\frac{e^{i(t-2)z}}{z^2} .$$
Then$$\left(\int_{-R}^{-\epsilon}+\int_\epsilon^R\right)\varphi (x)dx+\int_{C_\epsilon}\varphi (z)dz +\int_{C_R^+}\varphi (z)dz=2\pi i\operatorname{Res}(\varphi , 0),$$$$\left(\int_{-R}^{-\epsilon}+\int_\epsilon^R\right)\phi (x)dx+\int_{C_\epsilon}\phi (z)dz +\int_{C_R^-}\phi (z)dz=0.$$Therefore
$$ \left(\int_{-R}^{-\epsilon}+\int_\epsilon^R\right)\Phi (x)dx+\int_{C_\epsilon}\Phi (z)dz +\int_{C_R^+}\varphi (z)dz+\int_{C_R^-}\phi (z)dz=2\pi i\operatorname{Res}(\varphi , 0).$$Letting $R \to \infty$ and $\epsilon \to 0$, we find that$$\int_{-\infty}^\infty \Phi (x)dx=2\pi i \operatorname{Res}(\varphi , 0).$$
For $t$ with $2<t$, take $$\varphi (z)=\frac{1}{z^2}\left(e^{i(t+2)z}-e^{2itz}+e^{i(t-2)z}\right) \,\,\text{and}\,\, \phi(z)=0 .$$