It looks correct to me. I'd need FTP access and a URL for live testing to debug more if it doesn't work.
I'd suggest using DataBridge V2 to update your email code. The new update has a much improved email library that could improve your experience and results.