Ask Your Question
1

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

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

Benoit gravatar image

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

Evgeny gravatar image

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

Comments

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/__init__.py: format_instant_notification_email(), will add the tags. Thanks.
Evgeny gravatar imageEvgeny ( 2011-02-01 23:50:53 -0500 )edit
Thanks for the pointer. I thought I saw some emails with tags, and others without.
Benoit gravatar imageBenoit ( 2011-02-02 09:40:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

Evgeny gravatar image

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

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

Stats

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

Seen: 64 times

Last updated: Feb 03 '11