Fixes $data array warnings and double email content issue.

Jess, please review the updates, do some testing and then push to WP. Thanks!