Ask Your Question
0

Email subscription in plain text with markdown

asked 2014-10-14 17:09:10 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

I view my emails in plain text. For example, emails from stackexchange look fine both in html and in plain text. When in plain text, they are formatted in Markdown - [name] (url) for links, * text * for bold/emphasis.
In contrast, the emails from Ask Fedora viewed in plain text do not show the links in any way. Before I switched to HTML mode to troubleshoot this, I did not even know that there were links in the email.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-15 19:10:17 -0500

dnozay gravatar image

discussed this a bit at: ask.fedoraproject.org/en/question/55354/email-subscription-in-plain-text/


I checked the RSS feed, and it looks like legit markdown. so maybe it's just the emails.

  • celery task [send_instant_notifications_about_activity_in_post](https:// github.com/ASKBOT/askbot-devel/blob/master/askbot/tasks.py#L213-L283) send the email and calls
  • [askbot.models.format_instant_notification_email](https:// github.com/ASKBOT/askbot-devel/blob/master/askbot/models/__init__.py#L3198) which in turn calls
  • [askbot.mail.send_mail](https:// github.com/ASKBOT/askbot-devel/blob/master/askbot/mail/__init__.py#L108-L116) which in turn calls
  • [askbot.utils.html.get_text_from_html](https:// github.com/ASKBOT/askbot-devel/blob/master/askbot/utils/html.py#L148-L175) which
  • uses BeautifulSoup to transform the html into text; that's the part that strips html tags and that you would want to edit if you wanted to give the markdown syntax instead.

If you were going that route I would suggest to have footer notes e.g.

This is some email content with [some text][1].
Please check [your answer][2] or visit [your profile][3].

Links:
[1]: http://...
[2]: https://...
[3]: https://...

... rather than inline links.

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

1 follower

Stats

Asked: 2014-10-14 17:09:10 -0500

Seen: 115 times

Last updated: Oct 15 '14