Fix email sending, Fix javascript bug on add and delete event

Fix email sending
Fix javascript bug on add and delete event
Removed trailing white spaces