Older blog entries for Rich (starting at number 49)

Vanilla Forums: Email subject lines

Problem: Vanilla Forums sends out email on new messages and when a message has been commented on. The subject line is:

[Forum Name] rbowen started a discussion


[Forum Name] rbowen commented on your bookmarked discussion

Because the actual forum post title is missing, the chance of someone actually responding is pretty low.

So, I want to modify the subject line. However, Vanilla doesn't provide a simple way to do this, so I'll have to hack on the code itself.

Seemed like a good idea to document this, since I see the question asked a few places, but no answers.


1) Track down where that subject line is created.

Looking for the various phrases, it appears that the subject lines are created in applications/vanilla/settings/structure.php, around line 180. Look for the comment:

// Insert some activity types

2) Where is the email sent?

After some digging, it appears that this is actually done in the EmailSubscribe plugin, which would have been more evident, I suppose, if I had been the one that set up the forum. Oh well.

The trouble is, however, that the subject line is created in applications/vanilla/settings/structure.php (around line 180) as part of the event logging, and so we may have to recreate the subject line ourselves, rather than using the one that's passed in.

Around line 79 of plugins/EMailSubscribe/default.php, you'll see:

$Email->Subject(sprintf(T('[%1$s] %2$s'), Gdn::Config('Garden.Title'), $ActivityHeadline)); and I think that's where I'm going to want to ctually set the subject line. If it's a new post, I want it to be POST_TITLE , whereas, if it's a reply to a post, I'll want to have it be: Re: POST_TITLE So, first pass is to just do this:

                        // $Email->Subject(sprintf(T('[%1$s] %2$s'), Gdn::Config('Garden.Title'), $ActivityHeadline));
                        $Email->Subject(sprintf(T('[%1$s] %2$s'), Gdn::Config('Garden.Title'), $DiscussionName));
But that leaves off the Re: for replies, so I need to figure out when it's a reply. I will defeat you, EMailSubscribe

Syndicated 2013-08-06 18:28:45 from Notes In The Margin

The Mess

Ray wants to bake a cake.
Marguerite wants to float
on her gecko
in the pool.

These are, of course,
things, fun and profitable.

I must try to
think of the fun
and not the work it will create.

I must,
or they will remember
that I was

no fun.

So I must be sure we have eggs
and sunscreen
when he gets home,
and when she gets up.

Syndicated 2013-08-04 16:43:03 from Notes In The Margin

Setting your default printer

When I finally got printing working on my new HP5520, I discovered that apps like xpdf that print by invoking lpr directly would only work if I told them to use 'lpr -Php5520', which was a hassle. After some poking around, I discovered that the Cups web interface, at http://localhost:631/ let me set the default printer quite easily. Of course, you can do this via some config file or other, but this was easier. Here's how you do it.