Done using colorbox to share file and using delayed_job when sending email.
Fix bugs when merge