changing settings to constants and implementing email variables