Beispiel #1
0
        public Notificaciones()
        {
            _dalUsers = new DalUsers();
            Action someMethod = new Action(() =>
            {
                var apiKey = "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";
                var client = new SendGridClient(apiKey);


                var listaCorreos = _dalUsers.correos();
                foreach (string correo in listaCorreos)
                {
                    var msg = new SendGridMessage()
                    {
                        From             = new EmailAddress("*****@*****.**", "We Calendar"),
                        Subject          = "Hoy Tienes Eventos",
                        PlainTextContent = "prueba de envío de correos automatico",
                        HtmlContent      = "Hoy tienes eventos <button class=\"btn btn-default\">Wecalendar</button>"
                    };
                    msg.AddTo(new EmailAddress(correo, "Javier Fuentes"));
                    client.SendEmailAsync(msg);
                }
            });

            this.Schedule(someMethod).ToRunNow();
        }
 public TwitterRepository(IDalUsers dalUsers, IDalTweets dalTweets)
 {
     _dalUsers  = dalUsers;
     _dalTweets = dalTweets;
 }
Beispiel #3
0
 public SrvUser(IDalUsers dalUsers)
 {
     _dalUsers = dalUsers ?? throw new ArgumentNullException(nameof(dalUsers));
 }