updated some logic for main dashboard and made mailers dynamic to environment