Example #1
0
        public User(string name, string userName, EmailVO email, PasswordVO password, bool administrator)
        {
            Id            = Guid.NewGuid();
            Name          = name;
            UserName      = userName;
            Email         = email.ToString();
            Password      = password.ToString();
            Administrator = administrator;

            this.Validate();
            this.Password = this.CriptPassword(password.ToString());
        }
Example #2
0
        public Email(EmailVO to, EmailVO from, string body, Project project, string subject)
        {
            To      = to.ToString();
            From    = from.ToString();
            Body    = body;
            Project = project;
            Id      = Guid.NewGuid();
            Status  = StatusMailEnum.Sending;
            Date    = DateTime.Now;
            Subject = subject;

            this.Validate();
        }
Example #3
0
        public async Task Send(
            EmailVO to,
            string templateID,
            params KeyValuePair <string, string>[] values)
        {
            var mailEvent = new SendMailEvent
            {
                To            = to.ToString(),
                TemplateID    = templateID,
                ProjectApiKey = Guid.Parse(_settings.ProjectApiKey)
            };

            foreach (var value in values)
            {
                mailEvent.KeyValues.Add(value);
            }

            await _bus.Publish(mailEvent);
        }
Example #4
0
        public void Deve_Retornar_Email_Valido(string email)
        {
            var vo = new EmailVO(email);

            Assert.Equal(email, vo.ToString());
        }
Example #5
0
 public void SetEmail(EmailVO value)
 {
     this.Email = value.ToString();
     this.Validate();
 }