phpBB Digests

Customising digest emails - phpBB Digests

Customising digest emails

Postby nickharambee » Sat Feb 19, 2011 7:48 pm

Hi,

I have successfully installed the digest emails modification, but am wondering how to customise the look of the email that is sent out. I can see that mail_digests_html.html and mail_digests_text.html are involved, and also a file in the installation folder called ucp_digests.php, but I can't see where the ucp_digests.php file is on my server after installation.

I would be grateful for some help in getting this working.

Thanks

Nick
nickharambee
Registered User
 
Posts: 26
Joined: Sat Feb 13, 2010 3:55 pm

Re: Customising digest emails

Postby MarkDHamill » Sat Feb 19, 2011 8:05 pm

There are two sets of templates involved. Look also in /language/en/email.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Customising digest emails

Postby nickharambee » Sat Feb 19, 2011 8:16 pm

Thanks. I can see the txt files in /language/en/email, but still can't see where to set the content of the 'DIGEST_INTRODUCTION' placeholder.
nickharambee
Registered User
 
Posts: 26
Joined: Sat Feb 13, 2010 3:55 pm

Re: Customising digest emails

Postby MarkDHamill » Sat Feb 19, 2011 8:19 pm

That would be /language/en/mods/ucp_digests.php, most likely.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Customising digest emails

Postby nickharambee » Sat Feb 19, 2011 8:56 pm

Thanks. Got it. and thanks for a great mod

Nick
nickharambee
Registered User
 
Posts: 26
Joined: Sat Feb 13, 2010 3:55 pm

Re: Customising digest emails

Postby nickharambee » Sun Feb 20, 2011 11:19 am

Ah, there's one more thing I can't seem to get my head around. If I want to include an image/logo in the digest (the logo is on my server, and ideally would not be included as an attachment), what would be the best way to do this? I have tried including an href in all the files I can think it would go in, but no joy so far
nickharambee
Registered User
 
Posts: 26
Joined: Sat Feb 13, 2010 3:55 pm

Re: Customising digest emails

Postby MarkDHamill » Sun Feb 20, 2011 2:47 pm

Look in the Digests area of the Administration Control Panel. You can change the link to your logo image there.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Customising digest emails

Postby nickharambee » Sun Feb 20, 2011 8:17 pm

Thanks. I have added the custom logo to the Smartfeed area as instructed. Do I now need to include a placeholder for the logo in one of the template files?

I am still not too sure what all the various files do.

I can see that I edit the content of the text placeholders by editing "/language/en/mods/ucp_digests.php"

Then there are the following files:

language/en/email/digests_html.txt
.../digests_plain_html.txt
.../digests_text.txt

styles/subsilver2/template/mail_digests_html.html
.../mail_digests_text.html

If I do need to add a placeholder, which of these files do I edit?

Thanks

Nick
nickharambee
Registered User
 
Posts: 26
Joined: Sat Feb 13, 2010 3:55 pm

Re: Customising digest emails

Postby MarkDHamill » Mon Feb 21, 2011 3:17 am

Sorry, I should not have mentioned Smartfeed. That is my other mod and this topic is on my Digests mod.

Smartfeed and Digests work independently so if you are using Smartfeed as well, while your logo will show up in Smartfeed generated newsfeeds, it will not show up anywhere in the Digest. Digests does not support a feature to embed a logo. Sorry for the confusion.

To add a logo for the Digests, in principle you could add the logo to digests_html.text and digests_plain_html.txt. I have never done it. If you do fully qualify the URL to the logo. No logo would show up in a text digest so do not even try. This is because the MIME type will be set to text, so none would appear anyhow.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Customising digest emails

Postby ben.richardson » Tue Sep 06, 2011 3:50 am

Hello,

First of all, excellent work, love this mod. What about if we wanted a summary digest list. ie instead of sending a list of all posts for a topic in the email it just list the first post of a topic but says there has been x number of replys to this topic this week?

Thanks,
Ben
ben.richardson
Registered User
 
Posts: 6
Joined: Thu Jul 28, 2011 6:57 am

Re: Customising digest emails

Postby MarkDHamill » Tue Sep 06, 2011 12:19 pm

Right now you can select not to see any post text at all, or to show the first post of new topics only, but there is no feature to indicate how many posts are in the topic.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Customising digest emails

Postby Wiredfutureman » Wed Oct 05, 2011 2:07 pm

Hi Mark,

I'm trying to change the text-only version of the digest so that it includes a link to the posts.

However, I cannot seem to get it working right.

The templates I'm editing are:

/language/en/mail/digests_text.txt (to remove unwanted text and perhaps add some of my own)
/styles/prosilver/template/mail_digests_text.html

I've tried adding the following to the latter:

{L_DIGEST_BY}: {forum.topic.post.FROM} {L_DIGEST_ON} {forum.topic.post.DATE}
{forum.topic.post.ANCHOR}{forum.topic.post.POST_LINK}{L_DIGEST_LINK}

Which outputs <a name=""></a>123

Your help in this is much appreciated. Thanks.
Wiredfutureman
Registered User
 
Posts: 6
Joined: Thu Mar 03, 2011 6:29 pm

Re: Customising digest emails

Postby MarkDHamill » Wed Oct 05, 2011 4:16 pm

Sorry, probably can't help you. Customizing digests is a long topic that requires understanding of the templating system and understanding on how mail_digests.php works.

I think you want href instead of name.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Customising digest emails

Postby Wiredfutureman » Wed Oct 05, 2011 4:33 pm

Hi Mark, indeed I do just want to output the link to the post - nothing else. Does such a function exist?

The main reason behind this is that the HTML emails (both classic or standard) get send out as HTML but not actually displayed as such! People just see the HTML source code :(
Wiredfutureman
Registered User
 
Posts: 6
Joined: Thu Mar 03, 2011 6:29 pm

Re: Customising digest emails

Postby MarkDHamill » Wed Oct 05, 2011 4:47 pm

You probably want to hack line 1377 in mail_digests.php to get the behavior you want.

Code: Select all
            'POST_LINK'      => ($is_html) ? sprintf("<a href=\"%sviewtopic.$phpEx?f=%s&amp;t=%s&amp;p%s#p%s\">%s</a>%s", $board_url, $post_row['forum_id'], $post_row['topic_id'], $post_row['topic_first_post_id'], $post_row['post_id'], $post_row['post_id'], "\n") : $post_row['post_id'],


In your case you probably need to simplify it something like this:

Code: Select all
            'POST_LINK'      => sprintf("<a href=\"%sviewtopic.$phpEx?f=%s&amp;t=%s&amp;p%s#p%s\">%s</a>%s", $board_url, $post_row['forum_id'], $post_row['topic_id'], $post_row['topic_first_post_id'], $post_row['post_id'], $post_row['post_id'], "\n"),
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA