Stc2012
  • Posts: 4
  • Joined: 21/07/2012
On my forum option "Notification for topics you've posted to, watched or marked as favorite" don't work. E-mail don't sending.

Forum version: downloaded today v1.9.6.1 RTW Source Zipped from CodePlex.

PM notifications, PM Emails sends successfull. Email settings is good.

I'am investigated the code and found the problem: there is no functionality and source code for option "Notification for topics you've posted to, watched or marked as favorite".


            if (this.Get<YafBoardSettings>().AllowNotificationAllPostsAllTopics)
            {
                // TODO: validate permissions!
                usersWithAll = LegacyDb.UserFind(
                  YafContext.Current.PageBoardID, false, null, null, null, UserNotificationSetting.AllTopics.ToInt(), null);
            }
...

                // create individual watch emails for all users who have All Posts on...
                foreach (var user in usersWithAll.Where(x => x.UserID.HasValue && x.UserID.Value != userId))
                {
                    LegacyDb.eventlog_create(YafContext.Current.PageUserID, this, String.Format("user.ProviderUserKey={0}", user.ProviderUserKey), EventLogEntryType.Information);

                    // Make sure its not a guest
                    if (user.ProviderUserKey == null)
                    {
                        continue;
                    }

                    var membershipUser = UserMembershipHelper.GetUser(user.ProviderUserKey);

                    LegacyDb.eventlog_create(YafContext.Current.PageUserID, this, String.Format("membershipUser.Email={0}", membershipUser.Email), EventLogEntryType.Information);

                    if (!membershipUser.Email.IsSet())
                    {
                        continue;
                    }

                    watchEmail.TemplateLanguageFile = !string.IsNullOrEmpty(user.LanguageFile)
                                                          ? user.LanguageFile
                                                          : this.Get<ILocalization>().LanguageFileName;
                    watchEmail.SendEmail(
                        new MailAddress(this.Get<YafBoardSettings>().ForumEmail, this.Get<YafBoardSettings>().Name),
                        new MailAddress(membershipUser.Email, membershipUser.UserName),
                        subject,
                        true);
                }



Where is the code for UserNotificationSetting.TopicsISubscribeTo and UserNotificationSetting.TopicsIPostToOrSubscribeTo settings???

Please, help!
Sponsor
Jaben
  • Posts: 2544
  • Joined: 09/10/2004
Well, obviously it's not in that function. It's actually handled when a new topic is posted in the posts page.
Stc2012
  • Posts: 4
  • Joined: 21/07/2012
Hm...

Text from help:

"Notification for topics you've posted to, watched or marked as favorite - You will receive Instant Email Notifications when someone has posted a new Message in a topic, you have posted before, a topic you watch, marked as favorite, or a forum."

i.e.

You will receive Instant Email Notifications when someone has posted a new Message in a topic

Can you explain about posting new topic, when in help said about new message.

Function "Notification for topics you've posted to" don't work - it's a FACT!
tha_watcha
  • Posts: 4080
  • Joined: 06/03/2010
Quote:

Notification for topics you've posted to, watched or marked as favorite



Which part didnt work?

- Topic you posted to
- Watch Topic
- Or Favorited Topic?

I can confirm it works with all 3 on my test Installation with the current 1.9.6.2 beta from the repository 

One thing thats not included in the Help its sends only an email when someone else makes a new post.
UserPostedImage
Stc2012
  • Posts: 4
  • Joined: 21/07/2012
Sorry, up...
Stc2012
  • Posts: 4
  • Joined: 21/07/2012
Sorry, up...
tha_watcha
  • Posts: 4080
  • Joined: 06/03/2010
Originally Posted by: Stc2012

Sorry, up...



Sorry i hadn't much time lately, to do some testing.

I tested this Feature with Multiple Mail Host local/external various email accounts and it was always working. Also it works on this support forum.

There are 2 possibilities which could be a problem...


1. There is a Problem with the Mail Template used for that Mail. Did you use a different language then English in the forum or modified the language files? If not there should be no problem here

2. There is an Error thrown during the sending, the current release doesn't log such errors. You could take a look at Mail Table if there is any Mail left there is a problem with sending the email (Go to Admin -> Database ->Run SQL Query enter
SELECT TOP 1000 * FROM [{databaseOwner}].[{objectQualifier}Mail]
and Hit "Run Query")

This Maybe a shot in the dark but i attached the updated dlls for the 1.9.6.1 RTW (+ the Updated Source File) the YafSendMail Function now logs each Error that occurs when an Email sending fails.

And Please also update the sql sproc that retrieves the mails when sending, Go to Admin -> Database ->Run SQL Query enter....

ALTER PROCEDURE [{databaseOwner}].[{objectQualifier}mail_list]
(
	@ProcessID int
)
AS
BEGIN
	DECLARE @UTCTIMESTAMP datetime
	
	SET @UTCTIMESTAMP = GETUTCDATE()
	
	BEGIN TRANSACTION TRANSUPDATEMAIL
		UPDATE [{databaseOwner}].[{objectQualifier}Mail]
		SET 
			ProcessID = NULL
		WHERE
			ProcessID IS NOT NULL AND SendAttempt > @UTCTIMESTAMP

		UPDATE [{databaseOwner}].[{objectQualifier}Mail]
		SET 
			SendTries = SendTries + 1,
			SendAttempt = DATEADD(n,5,@UTCTIMESTAMP),
			ProcessID = @ProcessID
		WHERE
			MailID IN (SELECT TOP 10 MailID FROM [{databaseOwner}].[{objectQualifier}Mail] WHERE SendAttempt < @UTCTIMESTAMP OR SendAttempt IS NULL ORDER BY SendAttempt, Created)
	COMMIT TRANSACTION TRANSUPDATEMAIL

	-- now select all mail reserved for this process...
	SELECT TOP 10 * FROM [{databaseOwner}].[{objectQualifier}Mail] WHERE ProcessID = @ProcessID ORDER BY SendAttempt, Created desc	
END
File Attachment(s):
YafSendMailThreaded.cs (9kb) downloaded 37 time(s).
YAF-v1.9.6.1-RTW-Bin.zip (1,184kb) downloaded 33 time(s).

UserPostedImage
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved