Esempio n. 1
0
        public async Task <EmailArchieve> SendEmail(Guid id, bool resend = false)
        {
            var email = _emailArchieveService.GetById(id);

            if (email == null)
            {
                throw new Exception("Email archieve not found");
            }

            if (email.IsSent && !resend)
            {
                throw new Exception(string.Format("Email already sent at {0}",
                                                  _commonHelper.ToLongString(email.SentDate.Value)));
            }

            return(await SendEmail(email));
        }