Ask Your Question

Is there a tags variable available for instant_notification.html template?

asked 2011-02-01 13:23:54 -0600

Benoit's avatar

updated 2011-02-03 16:48:19 -0600

Evgeny's avatar

I would like to be able to put the list of tags for a question when an instant_notification is sent.

I'm customizing the text and I would like to get something like this:

Dear john,

bob sent a new question: How do I get my tags?
Tags: [askbot feature-request template]

This is just an example...

The variable would simply be a list of tags

edit retag flag offensive close merge delete


Actually, a large part of instant email formatting happens in the python code. I remember that when I created the template it wanted to be too complicated, so I moved most of the logic in the function askbot/models/ format_instant_notification_email(), will add the tags. Thanks.
Evgeny's avatar Evgeny  ( 2011-02-01 23:50:53 -0600 )edit
Thanks for the pointer. I thought I saw some emails with tags, and others without.
Benoit's avatar Benoit  ( 2011-02-02 09:40:46 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-02-01 13:36:01 -0600

Evgeny's avatar

updated 2011-02-03 16:52:07 -0600

The tag list is available through the .get_tag_names() method of post if the .post_type == 'question'.

edit - Added in 0.6.67. The email formatting is far from perfect though.

The tags are not present in the answer and comment updates, but will show in the new and updated question instant alerts.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-02-01 13:23:54 -0600

Seen: 160 times

Last updated: Feb 03 '11