News:

Wondering if this will always be free?  See why free is better.

Main Menu

Daily Digest eMail - How to add topic URL

Started by SportPistol, February 17, 2012, 10:06:20 PM

Previous topic - Next topic

SportPistol

In SMF 2.0.2, what must be configured so that Daily or Weekly Notification Digest includes the URL to the topic. 
Notifications are being sent but they just show topic name and number of posts.
Same or similar question was posted in http://www.simplemachines.org/community/index.php?topic=414520.0 
Solution was unclear to me in that post.

In SMF 1.x the configuration to include the URL to the Notification Digest was in Themes/default/languages/Post.english.php.

// Use numeric entities in the below five strings.
$txt['notify_boards'] = 'A new topic, \'%s\', has been made on a board you are watching.' . "\n\n" . 'You can see it at' . "\n" . '%s' . "\n\n";
$txt['notify_boards_subject'] = 'New Topic: %s';
$txt['notify_boards_once'] = "\n\n" . 'More topics may be posted, but you won\'t receive more email notifications until you return to the board and read some of them.';
$txt['notifyUnsubscribe'] = "\n\n" . 'Unsubscribe to this topic by clicking here';


Looked high and low for the answer.  Appreciate being directed to the solution.  Thanks in advance.

Storman™

Suggest you do what hadesflames said in that other topic. Basically edit /Sources/ScheduledTasks.php in the way he suggests.

Don't try editing the email template files as you won't be able to add the topic ids.

SportPistol

Thank you for causing me to take a closer look at the previous post. 
I implemented the changes in /Sources/ScheduledTasks.php suggested by hadesflames in topic
Daily Digest is now reporting new topics with URL links.
Next, I need to work out a few formatting quirks.
Here is an example of a Daily Digest entry including the double quotes.

"<a href="full url to post is here">Description of the topic is here</a>" in "<a href="full url to the forum board is here"> Forum  Board Name is Here</a>"

The implemented code is in the topic referenced above.
Any suggestions to tweak this solution to yield a correctly formatted output is appreciated.
I seek a solution to remove "<a href=" and <a> from the formatted results of the Daily Digest.

SportPistol

#3
Here is the line of code that I believe is suspect with respect to an absolute URL link. 
Author removed quoted code as no code changes are necessary.

Aleksi "Lex" Kilpinen

Any updates on this? Have you been able to sort things out?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

SportPistol

Thanks for asking.  Actually made the final changes to my message board yesterday.  Here is what I learned and implemented.
Received help from several sources to resolve the format question.
Hadeflames wrote the code to add the functionality of a daily or weekly digest e-mail containing url links to the topic.
First, install the code changes to ScheduledTasks.php as submitted in this topic by hadesflames .
The problem I reported in this thread was with the e-mail where URL links were not formatted right.  Cause turns out to be the eMail was being sent as plain text.
Solution from IchBin:  In ScheduledTasks.php, find and change the Sendmail() command to "true" so the message is sent as HTML.
sendmail($email['email'], $email['subject'], $email['body'], null, null, true, 4);
Now, after making the change to HTML, the message was one run on sentence.
Adjust line spacing spacing of the message with line breaks <br> as you see fit.  Here is one example of the change I made.
  $email['body'] .= "\n" . $langtxt[$lang]['new_replies'] . ':' . "\n" . '--'.'<br><br>';
Here is the post where I got the answer on changing the email to HTML.  topic
Hopefully a MOD will be made available to make this functionality outside of editing the ScheduledTasks.php file.  Here is the discussion on that topic
Problem closed.

Aleksi "Lex" Kilpinen

Glad to hear it's solved - And thank's for sharing the fix :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: