コード例 #1
0
ファイル: UserController.cs プロジェクト: mmach/krz
        public async Task <IHttpActionResult> SendMailToAll()
        {
            var    user     = _userServcice.Get(2);
            string modelXml = "";

            XmlSerializator.XmlSerialize(user, ref modelXml);
            QRCoderGenerator.GenerateSave(user.Guid.ToString(), $"{user.ExternalClientId}${user.BirthDate}");
            var xslt = Convert.ToString(Lips.Tool.Properties.Resources.ActivateNewUser);

            if (MailSend.SendMail(modelXml, xslt, ConfigurationManager.AppSettings["mail"], $"Activate User -  {user.Name}"))
            {
                return(Ok());
            }
            return(BadRequest());
        }
コード例 #2
0
ファイル: UserController.cs プロジェクト: mmach/krz
        private bool getNewQrClient(long userid)
        {
            var    user     = _userServcice.GetUserDetail(userid);
            string modelXml = "";

            XmlSerializator.XmlSerialize(user, ref modelXml);
            QRCoderGenerator.GenerateSave(user.Guid.ToString(), $"{user.ExternalClientId}${user.BirthDate}");
            string xslt = Convert.ToString(Lips.Tool.Properties.Resources.NewQRCodeLipsClient);

            if (MailSend.SendMail(modelXml, xslt, user.Email, $"Aanvraag QR code door {user.Name}, {user.Institution.Address}"))
            {
                xslt = Convert.ToString(Lips.Tool.Properties.Resources.NewQRCodeLips);

                if (MailSend.SendMail(modelXml, xslt, ConfigurationManager.AppSettings["mail"], $"Aanvraag QR code door {user.Name}, {user.Institution.Address}"))
                {
                    return(true);
                }
            }
            return(false);
        }