コード例 #1
0
        public static void SendBusRegEmplMail(string toAddress, string firstName, string busName, bool isExistingUser)
        {
            // Setup the email properties.
            var from     = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to       = new MailAddress[] { new MailAddress(toAddress) };
            var cc       = new List <MailAddress>();
            var bcc      = new List <MailAddress>();
            var html     = string.Empty;
            var text     = string.Empty;
            var textPlus = string.Empty;

            var subject = ConfigurationManager.AppSettings.Get("mailBusRegSubject");

            if (isExistingUser)
            {
                text = String.Format(ConfigurationManager.AppSettings.Get("mailBusRegExistingBody"), firstName, busName, ConfigurationManager.AppSettings.Get("ApiBaseURL"));
                html = MailTemplates.GetFormattedMailTemplate(subject, text);
            }
            else
            {
                text  = String.Format(ConfigurationManager.AppSettings.Get("mailBusRegNewBody"), firstName, busName, ConfigurationManager.AppSettings.Get("ApiBaseURL"));
                text += "<br><br>" + String.Format(ConfigurationManager.AppSettings.Get("mailBusRegNewBodyVisit"), ConfigurationManager.AppSettings.Get("ApiBaseURL"));
                html  = MailTemplates.GetFormattedMailTemplate(subject, text);
            }

            SendMail(from, to, subject, html, text);
        }
コード例 #2
0
        public static void SendReferralMail(string toAddress, string toName, string referrerName)
        {
            // Setup the email properties.
            var from = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to   = new MailAddress[] { new MailAddress(toAddress) };
            var cc   = new List <MailAddress>();
            var bcc  = new List <MailAddress>();

            var subject = ConfigurationManager.AppSettings.Get("mailReferSubject");
            var text    = String.Format(ConfigurationManager.AppSettings.Get("mailReferBody"), toName, referrerName, ConfigurationManager.AppSettings.Get("ApiBaseURL"));
            var html    = MailTemplates.GetFormattedMailTemplate(subject, text);

            SendMail(from, to, subject, html, text);
        }
コード例 #3
0
        public static void SendPasswordResetMail(string toAddress, string resetURL)
        {
            // Setup the email properties.
            var from = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to   = new MailAddress[] { new MailAddress(toAddress) };
            var cc   = new List <MailAddress>();
            var bcc  = new List <MailAddress>();

            var subject = ConfigurationManager.AppSettings.Get("mailPwdResetSubject");
            var text    = String.Format(ConfigurationManager.AppSettings.Get("mailPwdResetBody"), resetURL);
            var html    = MailTemplates.GetFormattedMailTemplate(subject, text);

            SendMail(from, to, subject, html, text);
        }
コード例 #4
0
        public static void SendConfirmationMail(string toAddress, string firstName, string confirmationURL)
        {
            // Setup the email properties.
            var from = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to   = new MailAddress[] { new MailAddress(toAddress) };
            var cc   = new List <MailAddress>();
            var bcc  = new List <MailAddress>();

            var subject = ConfigurationManager.AppSettings.Get("mailConfSubject");
            var text    = String.Format(ConfigurationManager.AppSettings.Get("mailConfBody"), firstName, confirmationURL);

            var mailHTML = MailTemplates.GetFormattedMailTemplate(subject, text, confirmationURL, "Verify email");

            SendMail(from, to, subject, mailHTML, text);
        }
コード例 #5
0
        public static void SendShiftCancelRequestMail(string toAddress, string firstName, string employeeName, string busLocation, DateTime shiftStart, DateTime shiftFinish)
        {
            // Setup the email properties.
            var from = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to   = new MailAddress[] { new MailAddress(toAddress) };
            var cc   = new List <MailAddress>();
            var bcc  = new List <MailAddress>();
            var html = string.Empty;
            var text = string.Empty;

            var subject = ConfigurationManager.AppSettings.Get("mailShiftCancelRequestSubject");

            text = String.Format(ConfigurationManager.AppSettings.Get("mailShiftCancelRequestBody"), firstName, employeeName, busLocation, shiftStart.ToString(), shiftFinish.ToString());
            html = MailTemplates.GetFormattedMailTemplate(subject, text);

            SendMail(from, to, subject, html, text);
        }
コード例 #6
0
        public static void SendShiftBroadcastMailAsync(string toAddress, string firstName)
        {
            // Setup the email properties.
            var from = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to   = new MailAddress[] { new MailAddress(toAddress) };
            var cc   = new List <MailAddress>();
            var bcc  = new List <MailAddress>();
            var html = string.Empty;
            var text = string.Empty;

            var subject = ConfigurationManager.AppSettings.Get("mailShiftBroadcastSubject");

            text = String.Format(ConfigurationManager.AppSettings.Get("mailShiftBroadcastBody"), firstName);
            html = MailTemplates.GetFormattedMailTemplate(subject, text);

            SendMail(from, to, subject, html, text);
        }
コード例 #7
0
        public static void SendOpenShiftRequestAcceptMail(string toAddress, string firstName, string shiftDetails)
        {
            // Setup the email properties.
            var from = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to   = new MailAddress[] { new MailAddress(toAddress) };
            var cc   = new List <MailAddress>();
            var bcc  = new List <MailAddress>();
            var html = string.Empty;
            var text = string.Empty;

            var subject = ConfigurationManager.AppSettings.Get("mailOpenShiftRequestAcceptedSubject");

            text = String.Format(ConfigurationManager.AppSettings.Get("mailOpenShiftRequestAcceptedBody"), firstName, shiftDetails);
            html = MailTemplates.GetFormattedMailTemplate(subject, text);

            SendMail(from, to, subject, html, text);
        }
コード例 #8
0
        public static void SendFeedbackMail(string email, string firstName, string feedback)
        {
            // Setup the email properties.
            var from = new MailAddress(ConfigurationManager.AppSettings.Get("mailFromAddress"));
            var to   = new MailAddress[] { new MailAddress(ConfigurationManager.AppSettings.Get("mailAdminToEmailAddress")) };
            var cc   = new List <MailAddress>();
            var bcc  = new List <MailAddress>();
            var html = string.Empty;
            var text = string.Empty;

            var subject = String.Format(ConfigurationManager.AppSettings.Get("mailAdminFeedbackSubject"), ConfigurationManager.AppSettings.Get("EnvironmentName"));

            text = String.Format(ConfigurationManager.AppSettings.Get("mailAdminFeedbackBody"), email, firstName, feedback);
            html = MailTemplates.GetFormattedMailTemplate(subject, text);

            SendMail(from, to, subject, html, text);
        }