예제 #1
0
        private static string RenderTemplate(string requestingMemberName, string groupName, string requestMessage, string groupMembersUrl, CultureInfo cultureInfo)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();
            Uri uri = new Uri(groupMembersUrl);

            dictionary["header"] = AntiXssEncoder.HtmlEncode(Strings.JoinRequestMessageHeading(requestingMemberName, groupName).ToString(cultureInfo), false);
            if (!string.IsNullOrEmpty(requestMessage))
            {
                dictionary["intro_text"]   = AntiXssEncoder.HtmlEncode(Strings.JoinRequestMessageAttachedBodyPrefix.ToString(cultureInfo), false);
                dictionary["user_message"] = AntiXssEncoder.HtmlEncode(requestMessage, false);
            }
            else
            {
                dictionary["intro_text"]   = AntiXssEncoder.HtmlEncode(Strings.JoinRequestMessageNoAttachedBodyPrefix.ToString(cultureInfo), false);
                dictionary["user_message"] = string.Empty;
            }
            dictionary["footer_text"] = Strings.JoinRequestMessageFooterTextWithLink(uri.ToString()).ToString(cultureInfo);
            return(GroupJoinRequestMessageBodyBuilder.RenderTemplate(GroupJoinRequestMessageBodyBuilder.JoinRequestHtmlTemplate.Value, dictionary));
        }
예제 #2
0
 public static void WriteMessageToStream(StreamWriter writer, string senderDisplayName, string groupDisplayName, string attachedMessageBody, MailboxUrls mailboxUrls, CultureInfo cultureInfo)
 {
     writer.Write(GroupJoinRequestMessageBodyBuilder.RenderTemplate(senderDisplayName, groupDisplayName, attachedMessageBody, GroupJoinRequestMessageBodyBuilder.ConvertFragmentToQuery(mailboxUrls.PeopleUrl), cultureInfo));
 }