public IObservable <int> SendAcceptanceEmail(ContactInvitation contactInvitation) { var templateId = _confiurationWrapper.GetConfigIntValue("WaiverEmailTemplateId"); var template = _communicationRepository.GetTemplate(templateId); // get the event name for the waiver... return(_eventParticipantRepository.GetEventParticpantByEventParticipantWaiver(contactInvitation.Invitation.SourceId).Select(ep => { var mergeData = new Dictionary <string, object> { { "Event_Name", ep.EventTitle }, { "Confirmation_Url", $"https://{_confiurationWrapper.GetConfigValue("BaseUrl")}/waivers/accept/{contactInvitation.Invitation.InvitationGuid}" } }; var comm = _communicationRepository.GetTemplateAsCommunication(templateId, template.FromContactId, template.FromEmailAddress, template.ReplyToContactId, template.ReplyToEmailAddress, contactInvitation.Contact.ContactId, contactInvitation.Contact.EmailAddress, mergeData); return _communicationRepository.SendMessage(comm); })); }
public async Task AddContactInvitation(Guid invitorContactId, Guid inviteeContactId, Guid organisationId) { var contactInvitation = new ContactInvitation() { InvitationDate = DateTime.UtcNow, OrganisationId = organisationId, InvitorContactId = invitorContactId, InviteeContactId = inviteeContactId }; await _assessorDbContext.ContactInvitations.AddAsync(contactInvitation); await _assessorDbContext.SaveChangesAsync(); }
public async Task SetInvitationAccepted(ContactInvitation contactInvitation) { contactInvitation.IsAccountCreated = true; contactInvitation.AccountCreatedDate = DateTime.UtcNow; await _assessorDbContext.SaveChangesAsync(); }