Esempio n. 1
0
        protected void btnJoin_Click(object sender, EventArgs e)
        {
            this.ProfileRedirect(Constants.UserPermission.CommunityUser);

            if (CurrentMember != null)
            {
                if (CurrentMember.ScreenName != null)
                {
                    if (IsMember)
                    {
                        try
                        {
                            Item grpItem = Groups.ConvertGroupIDtoSitecoreItem(GroupID);

                            string itemUrl = grpItem.GetUrl();
                            Response.Redirect(itemUrl, true);
                        }
                        catch (Exception ex)
                        {
                            Sitecore.Diagnostics.Error.LogError("Error in btnJoin_Click for Join Group Button function.\nError:\n" + ex.Message);
                        }
                    }
                    else
                    {
                        if (TelligentService.JoinGroup(GroupID, CurrentMember.ScreenName))
                        {
                            //Send Email
                            GroupItem      grpItem  = new GroupItem(Groups.ConvertGroupIDtoSitecoreItem(GroupID));
                            GroupCardModel grpModel = Groups.GroupCardModelFactory(grpItem);


                            BaseReply reply = ExactTargetService.InvokeEM9GroupWelcome(new InvokeEM9GroupWelcomeRequest
                            {
                                PreferredLanguage = CurrentMember.PreferredLanguage,
                                GroupLeaderEmail  = grpModel.ModeratorEmail,
                                GroupLink         = grpItem.GetUrl(),
                                GroupTitle        = grpItem.DisplayName,
                                ToEmail           = CurrentMember.Email,

                                GroupModerator = new Moderator
                                {
                                    groupModBioLink = grpModel.ModeratorBio,
                                    groupModImgLink = grpModel.ModeratorAvatarUrl, //owner.Avatar,
                                    groupModName    = grpModel.ModeratorName
                                }, RequestUrl = Request.Url
                            });

                            Text = DictionaryConstants.ViewDiscussionsLabel;
                        }
                    }
                }
            }
        }
        protected void btnEM9_Click(object sender, EventArgs e)
        {
            BaseReply reply = ExactTargetService.InvokeEM9GroupWelcome(new InvokeEM9GroupWelcomeRequest
            {
                PreferredLanguage = new Guid(ddlLanguages.SelectedValue),
                GroupLeaderEmail  = "*****@*****.**",
                GroupLink         = "www.google.com",
                GroupTitle        = "People testing Emails",
                ToEmail           = tbxSubscriberEmail1.Text,

                GroupModerator = new Moderator
                {
                    groupModBioLink = "www.google.com",
                    groupModImgLink = "images.google.com",
                    groupModName    = "Bob Smith"
                }
            });

            lblMessage.Text = reply.Message;
        }