First time here? Check out the FAQ!
1

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

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago
Benoit's avatar
875
Benoit
asked 14 years ago

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's avatar Evgeny (14 years ago)
Thanks for the pointer. I thought I saw some emails with tags, and others without.
Benoit's avatar Benoit (14 years ago)
see more comments

1 Answer

0

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago, answered 14 years ago
link

Comments

see more comments