示例#1
0
        public async Task SendCompanyLeadHooked(Guid leadId, IUrlHelper url, HttpRequest httpRequest)
        {
            var company = _uow.CompanyRepository.GetFirst();

            if (url == null)
            {
                if (this.Url == null)
                {
                    throw new ApplicationException("IUrlHelper in the context is null.");
                }
            }

            if (httpRequest == null)
            {
                if (this.Request == null)
                {
                    throw new ApplicationException("HttpRequest in the context is null.");
                }
            }

            var callbackLink = (url ?? this.Url).LeadHookedCallbackLink(leadId, (httpRequest != null) ? httpRequest.Scheme : this.Request.Scheme);

            var    lead         = _leadRepo.GetByUid(leadId);
            string leadTypeName = _leadTypeRepo.Get(lead.LeadTypeId)?.Name.ToLower();
            string subject      = $"New {leadTypeName} lead link";

            await _emailSender.SendCompanyLeadHookedAsync(subject, company.Email, callbackLink);
        }
示例#2
0
 public object Get(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(_leadTypeRepo.Get(), loadOptions));
 }