Ejemplo n.º 1
0
        public void SendAdminEmail(Voluntario voluntario)
        {
            // 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 Voluntá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>Anos de Experiência</th><th>Empres</th><th>Cargo</th>
            <th>Empresas Passadas</th><th>Segmentos</th><th>Áreas</th>
            <th>Escolaridade</th><th>LinkedIn</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><td>{11}</td><td>{12}</td><td>{13}</td>
            <td>{14}</td><td>{15}</td><td>{16}</td></tr></table>", voluntario.FirstName, voluntario.LastName, voluntario.Email,
            voluntario.PhoneNumber, voluntario.Address, voluntario.City,
            voluntario.State, voluntario.Country, string.Join(",", voluntario.Programs.ToArray()),
            voluntario.YearsOfExperience, voluntario.CurrentEmployer, voluntario.CurrentPosition,
            voluntario.PastEmployers, string.Join(",", voluntario.WorkSegments.ToArray()), string.Join(",", voluntario.WorkAreas.ToArray()), voluntario.Degree, voluntario.LinkedInProfile);

            this.SendEmail(myMessage);
        }
Ejemplo n.º 2
0
        public void SendVoluntarioWelcomeEmail(Voluntario voluntario)
        {
            // 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>
            {
                voluntario.Email
            };

            myMessage.AddTo(recipients);

            myMessage.Subject = "Bem-Vindo ao Projeto Joule!";

            //Add the HTML and Text bodies
            //myMessage.Html = "<p>Hello World!</p>";
            myMessage.Html = string.Format(@"<img src='http://projetojoule.com/wp-content/uploads/LogoNome.png' />
            <p>Olá {0},</p>
            <br />
            <p>Muito obrigado por ter preenchido seu cadastro e pelo seu interesse em nos ajudar como voluntário.
            Seja bem-vindo ao time do Projeto Joule, em breve entraremos em contato!</p>
            <br />
            <p>Por enquanto, não deixe de curtir nossa página e nos seguir nas redes sociais:</p>
            <br />
            <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>
            <br />
            <p>Um abraço,</p>
            <br />
            <p>Equipe Projeto Joule<p>", voluntario.FirstName);

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