Ejemplo n.º 1
0
        /// <summary>
        /// configファイルからSendGrid情報を取得する。
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public static SendGridInfo GetSendGridInfo(this IConfiguration config)
        {
            var sendGridSection = config.GetSection("SendGrid");
            var sendGridInfo    = new SendGridInfo(sendGridSection["ApiKey"], sendGridSection["DefaultFromAddress"], sendGridSection["DefaultToAddress"]);

            return(sendGridInfo);
        }
Ejemplo n.º 2
0
        private SendGridInfo CreateNewSendGridInfo()
        {
            SendGridInfo info = new SendGridInfo();

            info.Id            = Guid.NewGuid().ToString();
            info.SendDate      = DateTime.Now;
            info.NumberOfSends = 1;
            return(info);
        }