public int Sendemail(string email, string trainno, string delay, string arrival, string nextstationn) { tblEmailNotification notification = new tblEmailNotification(); notification.EmailTo = email; string htmlString = @"<html><body><p>Dear User,</p><p>Thank you for visiting our site,please find the below train details</p><p>TrainNo:" + trainno + "</p><p>Delay:" + delay + "Mins</p><p>Expected Arrival:" + arrival + "</p><p>Next Station:" + nextstationn + "</p><p>Sincerely,<br>-Railway Tracking System</br></p></body></html>"; notification.Message = htmlString; notification.CreatedDate = DateTime.Now; return(repo.AddEmailNotification(notification)); }
public int AddEmailNotification(tblEmailNotification notification) { db.tblEmailNotifications.Add(notification); return(db.SaveChanges()); }