public Request Convert(RequestChannel requestChannel, bool ignoreRecipients) { Request request = new Request(); Convert(requestChannel, request, ignoreRecipients); return request; }
public void Convert(RequestChannel requestChannel, Request request, bool ignoreRecipients) { request.PolicyType = PolicyType.ClientEmail.ToString(); request.DateTime = DateTime.Now; List<CustomProperty> props = new List<CustomProperty>(); props.Add(new CustomProperty(MailMessagePropertyKeys.FileHeader, string.Empty)); props.Add(new CustomProperty(MailMessagePropertyKeys.Body, m_emailProxy.BodyText)); props.Add(new CustomProperty(MailMessagePropertyKeys.FormattedBody, m_emailProxy.FormattedBodyText)); props.Add(new CustomProperty(MailMessagePropertyKeys.Subject, m_emailProxy.Subject)); props.Add(new CustomProperty(SMTPPropertyKeys.RequestChannel, requestChannel.ToString())); request.Properties = props.ToArray(); if (null == request.Source) request.Source = new RoutingEntity(); if (null == request.Destination) request.Destination = new RoutingEntity(); request.Source.RoutingType = RoutingTypes.Source; request.Source.Properties = new CustomProperty[] { new CustomProperty(SMTPPropertyKeys.RequestChannel, requestChannel.ToString()) }; request.Destination.RoutingType = RoutingTypes.Destination; request.Destination.Properties = new CustomProperty[] { new CustomProperty(SMTPPropertyKeys.RequestChannel, requestChannel.ToString()) }; request.Source.Items = new Workshare.PolicyContent.RoutingItem[0]; if (null == request.Destination.Items) request.Destination.Items = new Workshare.PolicyContent.RoutingItem[0]; request.Source.PolicyType = request.Destination.PolicyType = request.PolicyType; ProcessSender(request); if (!ignoreRecipients) { ProcessToRecipients(request); ProcessCcRecipients(request); ProcessBccRecipients(request); } ProcessAttachments(request); ProcessHeaders(request); ProcessMimeContentProperty(request); }