private void MessageReceived(object sender, MessageReceivedEventArgs e) { var groupId = 0; // Is there a group? if (!string.IsNullOrWhiteSpace(e.Message.Group)) { var group = _groupRepository.GetGroup(e.Message.Group); if (group != null) groupId = group.Id; } _emailRepository.SetEmail(new Email { From = e.Message.Sender, To = string.Join(";", e.Message.Recipients), Subject = e.Message.Subject, BodyHtml = e.Message.Message, GroupId = groupId }); }
protected virtual void OnMessageReceived(MessageReceivedEventArgs e) { MessageReceived?.Invoke(this, e); }