stuff to get automated email functionality to work