Prepare code layout and loops for email settings