Ejemplo n.º 1
24
        public void SendAdminEmail(Usuario usuario)
        {
            // Create the email object first, then add the properties.
            var myMessage = new SendGridMessage();

            // Add the message properties.
            myMessage.From = new MailAddress("*****@*****.**", "Projeto Joule");

            // Add multiple addresses to the To field.
            List<string> recipients = new List<string>
            {
                @"*****@*****.**"
            };

            myMessage.AddTo(recipients);

            myMessage.Subject = "Novo Usuário!";

            myMessage.Html += string.Format(@"<table>
            <tr><th>Nome</th><th>Sobrenome</th><th>Email</th>
            <th>Telefone</th><th>Endereço</th><th>Cidade</th>
            <th>Estado</th><th>País</th><th>Programas</th>
            <th>Profile</th><th>Sobre</th></tr>
            <tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td>
            <td>{4}</td><td>{5}</td><td>{6}</td><td>{7}</td><td>{8}</td>
            <td>{9}</td><td>{10}</td></tr></table>", usuario.FirstName, usuario.LastName, usuario.Email,
            usuario.PhoneNumber, usuario.Address, usuario.City,
            usuario.State, usuario.Country, string.Join(",", usuario.Programs.ToArray()),
            usuario.CurrentProfile, usuario.About);

            this.SendEmail(myMessage);
        }
Ejemplo n.º 2
0
        public void SendWelcomeEmail(Usuario usuario)
        {
            // Create the email object first, then add the properties.
            var myMessage = new SendGridMessage();

            // Add the message properties.
            myMessage.From = new MailAddress("*****@*****.**", "Projeto Joule");

            // Add multiple addresses to the To field.
            List<string> recipients = new List<string>
            {
                usuario.Email
            };

            myMessage.AddTo(recipients);
            myMessage.AddBcc(@"*****@*****.**");

            myMessage.Subject = "Obrigado!";

            //Add the HTML and Text bodies
            myMessage.Html = string.Format(@"<img src='http://projetojoule.com/wp-content/uploads/LogoNome.png' />
            <p>Olá {0},</p>
            <p>Muito obrigado por ter efetuado sua inscrição para participar nos programs do Projeto Joule.
            Este e-mail é para confirmar que recebemos sua inscrição e que estamos ansiosos para começar a trabalhar juntos.
            Em breve entraremos em contato!</p>
            <p>Por enquanto, não deixe de curtir nossa página e nos seguir nas redes sociais:</p>
            <p>Linkedin: <a href='https://www.linkedin.com/company/projeto-joule'>https://www.linkedin.com/company/projeto-joule</a> <br />

            Facebook: <a href='https://www.facebook.com/projetojoule'>https://www.facebook.com/projetojoule</a> <br />

            Twitter: <a href='https://twitter.com/projetojoule'>https://twitter.com/projetojoule</a> <br />

            Blog: <a href='http://www.projetojoule.com/blog'>http://www.projetojoule.com/blog</a></p>

            <p>Um abraço,</p>

            <p>Equipe Projeto Joule<p>", usuario.FirstName);
            //myMessage.Text = "Seja bem-vindo!";

            this.SendEmail(myMessage);
            this.SendAdminEmail(usuario);
        }