View unanswered posts | View active topics

Reply to topic  [ 8 posts ] 

Joined: Mon Mar 09, 2009 2:29 pm
Posts: 27
Post SendMail Channel Hook DEFAULT-SUBJECT-LINE
I am starting to use the SendMail hook a lot and I am running into a problem. The title of the email that gets sent by Awasu needs to be specific (for my use) but I can't seem to get it done.

The default {%DEFAULT-SUBJECT-LINE%} has the Word Awasu then the channel name & title. I just need title but I can't seem to get it to work that way. In the Channel Properties I have tried things like {%ITEM-TITLE%} {%ITEM-METADATA% name} and a few others but I just end up with the above in my email.

Is there a way of doing this?

Example: Cat1, Cat2 ITEM TITLE

I need to be able to add a couple of strings before the title and then send it. The strings are easy but the title isn't working.

Any ideas?

thanks

JerryMartin


Tue May 12, 2009 2:32 pm
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2902
Location: Melbourne, Australia
Post Re: SendMail Channel Hook DEFAULT-SUBJECT-LINE
Wow, I'm embarrassed :oops:

Firstly, while the <tt>SendEmail</tt> channel hook was written by us, it works in exactly the same way as any other user-written hook and has no special access into Awasu's database or anything like that. In particular, it doesn't have access to all the information about a feed item, only what Awasu passes through to it (or any other channel hook), which is fairly limited. So, <tt>{%ITEM-METADATA%}</tt> won't work. In fact, the only parameters available are <tt>{%DEFAULT-SUBJECT-LINE%}</tt> and <tt>{%CHANNEL-NAME%}</tt>. For the life of me, I can't think why the feed item title is not available (although I think it might possibly be due to some problem if the hook gets called for multiple feed items).

In the short term, I'll make a <tt>{%ITEM-TITLE%}</tt> parameter available. This change will be included in 2.4.1.alpha2 (in a week or two) so get yourself upgraded to alpha1 in the meantime.

Longer term, I'll look into how Awasu can pass through everything it knows about a feed item. I know <i>kevotheclone</i> is doing heaps of work with channel hooks right now and I'm sure he'd really dig that kind of thing :cool:


Wed May 13, 2009 8:13 am
Profile WWW

Joined: Mon Mar 09, 2009 2:29 pm
Posts: 27
Post 
It seems to have access to something because {%DEFAULT-SUBJECT-LINE%} produces the following result and works as expected with each email getting a different title. btw. I not using consolidated mode.

Awasu: digg.com: News / Popular send email test - Society for Geek Advancement

Channel name = digg.com: News / Popular send email test
Item title = Society for Geek Advancement

I looked around in the code hoping to a least get rid of the word Awasu but that didn't work.

This seems like a pretty important feature, and I'm sure you'll take care of it.

Much appreciation,

Jerry


Wed May 13, 2009 12:42 pm
Profile WWW
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 227
Location: Elk Grove, California
Post Re: SendMail Channel Hook DEFAULT-SUBJECT-LINE
Quote:
I know kevotheclone is doing heaps of work with channel hooks right now and I'm sure he'd really dig that kind of thing


Taka, where is the :salivating in anticipation: emoticon? I looked all over the forum and couldn't find it. It's seems like a most appropriate emoticon for an Awasu forum doesn't it?

Over the last couple of days Taka, has a gotten a look via email into some of the deep, dark recesses of kevotheclone's mind. There are plenty of other recesses filled with secret Awasu extensions that Taka is not yet aware of, but in time he will, and if you're watching the forums and the wiki you will too.

As I mentioned previously I'll try to keep a steady trickle of extensions coming; at least one a month.

Thanks again for the robust framework that makes our extensions look good without having to kill ourselves writing 1,000s of lines of code! :bow:

:afro:


Wed May 13, 2009 4:17 pm
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2902
Location: Melbourne, Australia
Post Re: SendMail Channel Hook DEFAULT-SUBJECT-LINE
kevotheclone wrote:
Taka, where is the :salivating in anticipation: emoticon? I looked all over the forum and couldn't find it. It's seems like a most appropriate emoticon for an Awasu forum doesn't it?

I know which one I need right now...

:wall:

Awasu has long passed the point where I can remember everything that's in it. It already passes through everything it knows about each new feed item. The <tt>ItemMetadata</tt> value contains an XML tree <sup><small><i>(*)</i></small></sup> of all the metadata associated with the item, plus you have things like <tt>ItemUrl</tt>, <tt>ItemTitle</tt>, etc.

Sigh... :roll:

<small><i><sup>(*)</sup> Although I just noticed that the XML is technically invalid since it doesn't have a root node. I wonder if anyone's using it or if I can fix it...</i></small>


Thu May 14, 2009 7:36 am
Profile WWW

Joined: Mon Mar 09, 2009 2:29 pm
Posts: 27
Post 
Taka, I did notice a while back that an xml that I created from Awasu did not validate. I'm not sure if thats exactly what you were referring to nor can I remember how I created the xml. I believe it may have been while printing a channel report.

Kevo, thanks for all the work you are doing and your helpful support. I am invested in Awasu and I'm watching patiently while you guys make it do new tricks.

I will also try to help in anyway I can (but not a coder) as time allows.

My next major task is to get the webscraper to actually do something. So far I have had nothing but failures.

Have a nice day.

Jerry


Thu May 14, 2009 9:03 am
Profile WWW
User avatar

Joined: Mon Sep 08, 2008 3:16 pm
Posts: 227
Location: Elk Grove, California
Post Re: SendMail Channel Hook DEFAULT-SUBJECT-LINE
Quote:
(*) Although I just noticed that the XML is technically invalid since it doesn't have a root node. I wonder if anyone's using it or if I can fix it...


I never looked at the ItemMetadata value until you just mentioned it. I noticed that in addition to needing a root node, it also needs the ampersands escaped ("&" should be "&amp;"). I can see in one feed title that you got the apostrophe escaped correctly so maybe the ampersand is the only one that escaped your watchful eyes.


Thu May 14, 2009 4:01 pm
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2902
Location: Melbourne, Australia
Post 
jerrymartin wrote:
Taka, I did notice a while back that an xml that I created from Awasu did not validate. I'm not sure if thats exactly what you were referring to

No, this is something different.

jerrymartin wrote:
nor can I remember how I created the xml. I believe it may have been while printing a channel report.

If you were generating it from a channel report, then there was probably something wrong with the template :-)

jerrymartin wrote:
My next major task is to get the webscraper to actually do something. So far I have had nothing but failures.

I agree, it can been a bit of a hassle getting the regular expressions right but it does seem to work. Eventually... :roll: Post here in the forums if you're having problems and we'll get you sorted out.


Fri May 15, 2009 6:27 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online
Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: