forked from mozilla/kitsune
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug 623982, bug 629520] Anonymous watches. Delete watch when deliver…
…y fails. * Add an is_active column. * Add stub implementation for confirmation email. * Update .notify() to send a confirmation email and raise an ActivationRequestFailed exception if the email message fails to send. * Add function Event._activation_email, which receives a watch and an email and returns an EmailMessage. * Make questions anonymous watches work, add extra views for confirming/unsubscribing from watches. * Add Event.get_activation_url() for use in email templates. * Add Event.get_watch_description() for events to describe their watches in string form. This comes in handy when sending out emails, to explain why the receiver is getting this. * Catch SMTPRecipientsRefused exception and show message about it. * Update wiki tests.
- Loading branch information
Paul Craciunoiu
committed
Feb 8, 2011
1 parent
fc33d57
commit 24a13e5
Showing
15 changed files
with
335 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{# vim: set ts=2 et sts=2 sw=2: #} | ||
{% extends "questions/base.html" %} | ||
{% if is_active %} | ||
{% set title = _('Subscription confirmed.') %} | ||
{% else %} | ||
{% set title = _('There was a problem confirming your subscription.') %} | ||
{% endif %} | ||
{% set classes = 'questions' %} | ||
|
||
{% block content %} | ||
<div class="activate-watch"> | ||
<h2>{{ question.title }}</h2> | ||
{% if is_active %} | ||
<h3> | ||
{{ _('You will now receive updates via email.') }} | ||
</h3> | ||
<ul> | ||
<li> | ||
<a href="{{ question.get_absolute_url() }}" id="activate-watch"> | ||
{{ _('Go back to the question.') }} | ||
</a> | ||
</li> | ||
<li> | ||
<a id="remove-watch" href="{{ unsubscribe_url }}"> | ||
{{ _('Stop receiving updates via email for this question.') }} | ||
</a> | ||
</li> | ||
</ul> | ||
{% else %} | ||
<h3>{{ title }}</h3> | ||
<a href="{{ question.get_absolute_url() }}" id="activate-watch"> | ||
{{ _('Go back to the question and try again.') }} | ||
</a> | ||
{% endif %} | ||
</div> | ||
{% endblock %} |
13 changes: 13 additions & 0 deletions
13
apps/questions/templates/questions/email/activate_watch.ltxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% load i18n %}{# L10n: This is an email. Whitespace matters! #}{% blocktrans %} | ||
You are about to subscribe to: | ||
{{ watch_description }} | ||
|
||
To confirm your subscription, please click the link below | ||
or copy and paste the whole thing into your browser's location bar: | ||
|
||
https://{{ domain }}{{ activation_url }} | ||
|
||
Thanks! | ||
|
||
The {{ domain }} team | ||
{% endblocktrans %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{# vim: set ts=2 et sts=2 sw=2: #} | ||
{% extends "questions/base.html" %} | ||
{% if success %} | ||
{% set title = _('You have been unsubscribed.') %} | ||
{% else %} | ||
{% set title = _('There was a problem unsubscribing.') %} | ||
{% endif %} | ||
{% set classes = 'questions' %} | ||
|
||
{% block content %} | ||
<div class="unsubscribe-watch"> | ||
<h2>{{ title }}</h2> | ||
<p> | ||
{% if success %} | ||
{% trans question_title=question.title %} | ||
You will no longer receive email updates for this question: | ||
<a href="{{ question_url }}">{{ question_title }}</a> | ||
{% endtrans %} | ||
{% else %} | ||
{% trans question_title=question.title, | ||
question_url=question.get_absolute_url() %} | ||
We could not unsubscribe you from this question: | ||
<a href="{{ question_url }}">{{ question_title }}</a>. | ||
Please make sure you copied and pasted the unsubscribe link correctly. | ||
{% endtrans %} | ||
{% endif %} | ||
</p> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.