• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

email notification - watched threads

Ryan Kent

Well-known member
#1
I joined SEOmoz recently. I really like a couple aspects of how they engage their community. One example is the emails they send for watched threads. Rather then the simple text the default XF install sends, their e-mails are much more engaging.

Can anyone tell me if this type of e-mail is with template edits? Or would an add-on be required?

SEOmoz email.JPG
 

Jake Bunce

XenForo moderator
Staff member
#2
Admin CP -> Appearance -> Search Phrases

Search for "watched_thread_reply_email_html" in the title. You can use HTML formatting in this phrase.
 

Ryan Kent

Well-known member
#3
As always, thanks Jake.

My more specific question would be, would the HTML in the template have access to user avatars, forum node names, user names, and forum thread titles/content necessary to send that information? I know templates have limited visibility to data, I have no understanding how it would work from a phrase.
 

Jake Bunce

XenForo moderator
Staff member
#4
You don't have access to that information in that phrase. Code changes are required.

I did some poking around and it looks like the variables that are available to that phrase are defined in the email templates. Here is the email template for that phrase which defines all available variables:

Code:
{xen:phrase watched_thread_reply_email_html,
	"receiver_username={$receiver.username}",
	"username={$reply.username}",
	"title={$thread.titleCensored}",
	"view_link={xen:link 'canonical:posts', $reply}",
	"manage_link={xen:link 'canonical:watched/threads/all'}"
}
I don't see a front end for the email templates. I had to pull this from the database. Or they are also in this file:

install/data/email_templates.xml
 

Ryan Kent

Well-known member
#5
Getting a lot closer. Final question. Is adding the missing variables such as reply.avatar, the first ?50 chars of the thread, node name, etc as simple as adding them to that XML file? Or is it more involved?