Stc2012
  •  Stc2012
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-07-21T14:46:26Z
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
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2012-07-23T01:56:12Z
Well, obviously it's not in that function. It's actually handled when a new topic is posted in the posts page.
Stc2012
  •  Stc2012
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-07-23T07:00:05Z
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
2012-07-23T13:31:29Z
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
  •  Stc2012
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-07-23T15:29:58Z
Hi.

Originally Posted by: tha_watcha 



- Topic you posted to



But I'm not creator of the topic.

For examle: user A created topic, user B (I'am, in my profile option "Notification for topics you've posted to, watched or marked as favorite" is on) post a message in this topic, user C post a message in topic. - E-mail for user B not sending.
Stc2012
  •  Stc2012
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-07-25T15:49:06Z
Stc2012
  •  Stc2012
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-07-30T06:04:25Z
tha_watcha
2012-07-30T11:56:55Z
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 45 time(s).
YAF-v1.9.6.1-RTW-Bin.zip (1,184kb) downloaded 41 time(s).

UserPostedImage

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