Exemplo n.º 1
0
        /// <summary>
        /// Connects to database and save email for subscribing.
        /// </summary>

        public async Task <int> SaveEmailSubscriber(NL_UserInfo objInfo)
        {
            try
            {
                List <SQLParam> Param = new List <SQLParam>
                {
                    new SQLParam("@SubscriberID", objInfo.SubscriberID),
                    new SQLParam("@SubscriberEmail", objInfo.SubscriberEmail),
                    new SQLParam("@ClientIP", objInfo.ClientIP),
                    new SQLParam("@FirstName", objInfo.FirstName),
                    new SQLParam("@LastName", objInfo.LastName),
                    new SQLParam("@Location", objInfo.Location),
                    new SQLParam("@Gender", (int)objInfo.Gender),
                    new SQLParam("@InterestInAll", objInfo.InterestInAll),
                    new SQLParam("@Interest", objInfo.Interest),
                    new SQLParam("@IsImported", objInfo.IsImported),
                    new SQLParam("@RecipientGroup", objInfo.RecipientGroup),
                    new SQLParam("@CompanyName", objInfo.CompanyName),
                    new SQLParam("@PhoneNumber", objInfo.PhoneNumber),
                    new SQLParam("@Profession", objInfo.Profession),
                    new SQLParam("@Source", objInfo.Source),
                    new SQLParam("@AddedBy", objInfo.AddedBy)
                };
                SQLExecuteNonQueryAsync sqlh = new SQLExecuteNonQueryAsync();
                return(await sqlh.ExecuteNonQueryAsync("[dbo].[usp_Wb_Mail_NL_Subscriber_Add]", Param, "@OpStatus"));
            }
            catch
            {
                throw;
            }
        }
Exemplo n.º 2
0
 public async Task <int> SaveEmailSubscriber(NL_UserInfo objInfo)
 {
     try
     {
         NL_Provider cont = new NL_Provider();
         return(await cont.SaveEmailSubscriber(objInfo));
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 3
0
        public async Task SendMailToUser(string Email)
        {
            NL_UserInfo _UserInfo = await this.GetByEmail(Email);

            if (_UserInfo != null)
            {
                Cbuilder.EmailTemplate.EmailTemplate mail = await _emailTemplate.GetByIdentifier("subscription-65F1A79A");

                //string hostURL = TokenController.GetCurrnetHostURL();

                if (mail != null)
                {
                    List <TokenKeyValue> lstToken = new List <TokenKeyValue>
                    {
                        new TokenKeyValue {
                            Key = MailToken.FirstName, Value = _UserInfo.FirstName
                        },
                        new TokenKeyValue {
                            Key = MailToken.LastName, Value = _UserInfo.LastName
                        },
                        new TokenKeyValue {
                            Key = MailToken.Email, Value = _UserInfo.SubscriberEmail
                        },
                        new TokenKeyValue {
                            Key = MailToken.UnsubscribeLink, Value = _UserInfo.UniqueCode
                        },
                        new TokenKeyValue {
                            Key = MailToken.UserName, Value = string.Empty
                        },
                        new TokenKeyValue {
                            Key = MailToken.CurrnetHostURL, Value = ""
                        }
                    };
                    mail.ViewDOM = _emailTemplate.ReplaceToken(mail.ViewDOM, lstToken);
                    string AdminMail = /*pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalAdminEmail)*/ "";
                    _emailSender.SendEmailAsync(_UserInfo.SubscriberEmail, mail.Subject, mail.ViewDOM);
                }
            }
        }