Customising digest emails - phpBB Digests
Customising digest emails
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
- MarkDHamill
- Registered User
- Posts: 2117
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Oak Hill, Virginia USA
Re: Customising digest emails
- nickharambee
- Registered User
- Posts: 26
- Joined: Sat Feb 13, 2010 3:55 pm
Re: Customising digest emails
- MarkDHamill
- Registered User
- Posts: 2117
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Oak Hill, Virginia USA
Re: Customising digest emails
Nick
- nickharambee
- Registered User
- Posts: 26
- Joined: Sat Feb 13, 2010 3:55 pm
Re: Customising digest emails
- nickharambee
- Registered User
- Posts: 26
- Joined: Sat Feb 13, 2010 3:55 pm
Re: Customising digest emails
- MarkDHamill
- Registered User
- Posts: 2117
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Oak Hill, Virginia USA
Re: Customising digest emails
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
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.
- MarkDHamill
- Registered User
- Posts: 2117
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Oak Hill, Virginia USA
Re: Customising digest emails
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
- MarkDHamill
- Registered User
- Posts: 2117
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Oak Hill, Virginia USA
Re: Customising digest emails
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
I think you want href instead of name.
- MarkDHamill
- Registered User
- Posts: 2117
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Oak Hill, Virginia USA
Re: Customising digest emails
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
- Code: Select all
'POST_LINK' => ($is_html) ? sprintf("<a href=\"%sviewtopic.$phpEx?f=%s&t=%s&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&t=%s&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"),
- MarkDHamill
- Registered User
- Posts: 2117
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Oak Hill, Virginia USA