Exemplo n.º 1
0
    public static void Main()
    {
        EmailNotify emailNotify = new EmailNotify();
        MailWatch   mailWatch   = new MailWatch(emailNotify);

        emailNotify.NotifyMail("Hello!", "Welcome to Events!!");
    }
Exemplo n.º 2
0
        public override void Deliver(string description)
        {
            EmailNotify emailNotify = new EmailNotify();

            emailNotify.Notify(description);
            SMSNotify smsNotify = new SMSNotify();

            smsNotify.Notify(description);
        }
Exemplo n.º 3
0
        public override void Deliver(string description)
        {
            EmailNotify emailNotify = new EmailNotify();

            emailNotify.Notify(description);
            PortalNotify portalNotify = new PortalNotify();

            portalNotify.Notify(description);
        }
Exemplo n.º 4
0
 public MailWatch(EmailNotify emailNotify)
 {
     this.emailNotify              = emailNotify;
     emailNotify.OnNewMailHandler += new EmailNotify.NewMailEventHandler(IHaveMail);
 }
Exemplo n.º 5
0
 public void EmailOnOpenSlot(int reservationId, DateTime beginDateTime, DateTime endDateTime, EmailNotify notifyType, int clientId)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (_flag_BIDV)
            {
                BIDVCrawler.Run();
            }

            if (_flag_ASPNET)
            {
                ASPNETCrawler.Run();
            }

            if (_flag_Mp3Zing)
            {
                Console.WriteLine("");
            }

            try
            {
                EmailNotify notify = new EmailNotify();
                notify.SendMail(this._contacts, "TIN TỨC TRONG NGÀY", Newsletter.BuildNewsletter(), true); ;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 7
0
        //Email users who want to be notified of open reservation slots
        public void EmailOnOpenSlot(int reservationId, DateTime beginDateTime, DateTime endDateTime, EmailNotify notifyType, int clientId)
        {
            IList <ResourceClientInfo> clients = null;
            string footer = string.Empty;

            var rsv = Require <ReservationInfo>(reservationId);

            if (notifyType == EmailNotify.Always)
            {
                clients = Session.SelectNotifyOnCancelClients(rsv.ResourceID).ToList();
                footer  = string.Format("Sent to NotifyOnCancel clients, ReservationID: {0}", rsv.ReservationID);
            }
            else if (notifyType == EmailNotify.OnOpening)
            {
                clients = Session.SelectNotifyOnOpeningClients(rsv.ResourceID).ToList();
                footer  = string.Format("Sent to NotifyOnOpening clients, ReservationID: {0}", rsv.ReservationID);
            }

            if (clients == null || clients.Count == 0)
            {
                return;
            }

            string        fromAddr, subject, body;
            List <string> toAddr = new List <string>();

            fromAddr = Properties.Current.SchedulerEmail;
            subject  = $"{SendEmail.CompanyName} - Open reservation slot for {rsv.ResourceName}";
            body     = string.Format("{0} just became available for reservation from {1} to {2}.{4}{4}If you wish to reserve this resource, please sign up quickly.{4}{4}--------------------{4}{4}{3}",
                                     rsv.ResourceName,
                                     beginDateTime.ToString(Reservation.DateFormat),
                                     endDateTime.ToString(Reservation.DateFormat),
                                     footer,
                                     Environment.NewLine
                                     );

            foreach (ResourceClientInfo rc in clients)
            {
                if (!rc.IsEveryone())
                {
                    toAddr.Add(rc.Email);
                }
            }

            if (toAddr.Count == 0)
            {
                return;
            }

            SendEmail.Send(clientId, "LNF.Scheduler.EmailUtility.EmailOnOpenSlot", subject, body, fromAddr, toAddr);
        }