public void SendTestEmail( Post post, User user ) { string emailSubject = "Test PostMail"; IDictionary tokens = new Hashtable(); tokens.Add( "post", post ); tokens.Add( "user", user ); tokens.Add( "postdate", post.PublishDateTime.ToFriendlyJumblistLongDateTimeString( false ) ); tokens.Add( "homeurl", homeUrl ); string emailBody = GenerateEmailText( tokens, "TestEmail.vm" ); SendMail( user.Email, emailSubject, emailBody, true ); }
public void SendPostEmail( Post post, string email ) { string emailSubject = "Post Mail"; IDictionary tokens = new Hashtable(); tokens.Add( "post", post ); tokens.Add( "postdate", post.PublishDateTime.ToFriendlyJumblistLongDateTimeString( false ) ); tokens.Add( "homeurl", homeUrl ); string emailBody = GenerateEmailText( tokens, "PostEmailUnauthenticated.vm" ); //SendMailAsync( email, emailSubject, emailBody, true ); SendMail( email, emailSubject, emailBody, true ); }
public static Expression<Func<Post, bool>> WhereNotEquals( Post post ) { return x => x.PostId != post.PostId; }
public static Expression<Func<PostLocation, bool>> WherePostEquals( Post post ) { return x => x.PostId == post.PostId; }
public void ClearItem( Post post ) { items.RemoveAll(p => p.PostId == post.PostId ); }
public void AddItem( Post post ) { var first = items.FirstOrDefault( p => p.PostId == post.PostId ); if (first == null) items.Add( post ); }
private void SavePostsToDatabase( Feed feed, SyndicationFeed feedOutput ) { var postService = ServiceLocator.Current.GetInstance<IPostService>(); foreach (var item in feedOutput.Items) { if ( ((IDataService<Post>)postService).IsDuplicate( Post.WhereUrlEquals( item.Links[0].Uri.ToString() ) ) ) continue; var post = new Post(); //post.Guid = item.Id; post.Url = item.Links[0].Uri.ToString(); post.Title = item.Title.Text; post.Body = item.Summary.Text; post.PublishDateTime = item.PublishDate.LocalDateTime; post.LastUpdatedDateTime = item.LastUpdatedTime.LocalDateTime; post.Display = false; post.UserId = User.Anonymous.UserId; post.FeedId = feed.FeedId; post.LastUpdatedDateTime = DateTime.Now; post.PostCategoryId = postService.ExtractPostCategoryId( post ); if ( PostCategoryId.Wanted.Is( post.PostCategoryId ) || PostCategoryId.Offered.Is( post.PostCategoryId ) ) { postService.Import( post ); } } }