wired up claim notifications [#37257639]

pull/1/head
eric 2013-11-06 14:58:50 -05:00
parent 31512d36b0
commit ca540c4cb4
8 changed files with 60 additions and 28 deletions

View File

@ -144,6 +144,18 @@ class Claim(models.Model):
return True
def __unicode__(self):
return self.work.title
def notify_claim(sender, created, instance, **kwargs):
try:
(rights, new_rights) = User.objects.get_or_create(email='rights@gluejar.com',defaults={'username':'RightsatUnglueit'})
except:
rights = None
if instance.user == instance.rights_holder.owner:
ul=(instance.user, rights)
else:
ul=(instance.user, instance.rights_holder.owner, rights)
notification.send(ul, "rights_holder_claim", {'claim': instance,})
post_save.connect(notify_claim,sender=Claim)
class RightsHolder(models.Model):
created = models.DateTimeField(auto_now_add=True)

View File

@ -110,7 +110,7 @@ def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("pledge_charged", _("Your Pledge has been Executed"), _("You have contributed to a successful ungluing campaign."))
notification.create_notice_type("pledge_failed", _("Unable to charge your credit card"), _("A charge to your credit card did not go through."))
notification.create_notice_type("rights_holder_created", _("Agreement Accepted"), _("You have become a verified Unglue.it rights holder."))
notification.create_notice_type("rights_holder_claim_approved", _("Claim Accepted"), _("A claim you've entered has been accepted."))
notification.create_notice_type("rights_holder_claim", _("Claim Entered"), _("A claim has been entered."))
notification.create_notice_type("wishlist_unsuccessful_amazon", _("Campaign shut down"), _("An ungluing campaign that you supported had to be shut down due to an Amazon Payments policy change."))
notification.create_notice_type("pledge_donation_credit", _("Donation Credit Balance"), _("You have a donation credit balance"))
notification.create_notice_type("new_wisher", _("New wisher"), _("Someone new has wished for a book that you're the rightsholder for"))

View File

@ -0,0 +1,23 @@
{% ifequal claim.status 'active' %}
Congratulations! {{ claim.rights_holder }}'s claim to {{ claim.work }} on Unglue.it has been approved.
You are now free to start a campaign to sell or unglue your work. If you're logged in, you will see the option to open a campaign at https://{{ current_site.domain }}/rightsholders . (You can also find this page by clicking on "Rights Holder Tools" at the bottom of any Unglue.it page.)
To run a campaign, you'll need to set up campaign parameters. You'll also need to write a pitch. This will appear in the Description tab on your book's page (https://{{ current_site.domain }}{% url work claim.work.id %}). Think about who your book's audience is, and remind them why they'll love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. Feel free to email us (rights@gluejar.com) if you need any help with this.
If you're running a Pledge Campaign, you need to decide on a funding target, and you should also come up with some custom premiums to reward ungluers for supporting your book. Again, we can help you if you need ideas for what these should be or how to price them.
If you're running a Buy-to-Unglue Campaign, now is the time to upload your EPUB file and decide on revenue targets and pricing for individual and library licenses.
Finally, think about how you're going to publicize your campaign: social media, newsletters, media contacts, professional organizations, et cetera. Have a plan for how to reach out to these potential supporters before you launch your campaign. Your supporters' sense of connection with you and your book is key to your campaign's success. Again, email us if you'd like help.
We're thrilled to be working with you.
{% endifequal %}
{% ifequal claim.status 'pending' %}
{{ claim.rights_holder }}'s claim to {{ claim.work }} on Unglue.it has been entered. Our team will examine the claim and get back to you soon.
{% endifequal %}
{% ifequal claim.status 'release' %}
{{ claim.rights_holder }}'s claim to {{ claim.work }} on Unglue.it has been released. email us (rights@gluejar.com) if you have any questions about this.
{% endifequal %}
The Unglue.it team

View File

@ -0,0 +1,23 @@
{% extends "notification/notice_template.html" %}
{% block comments_book %}
<a href="{% url work claim.work.id %}"><img src="{{ claim.work.cover_image_small }}" alt="cover image for {{ claim.work.title }}" /></a>
{% endblock %}
{% block comments_graphical %}
{{ claim.rights_holder }}'s Claim to {{ claim.work.title }} is now {{ claim.status }}.
{% endblock %}
{% block comments_textual %}
{{ claim.rights_holder }}'s Claim to {{ claim.work.title }} is now {{ claim.status }}.
<br /><br />
{% ifequal claim.status 'active' %}
To get started on the on a campaign, please visit <a href="{% url rightsholders %}">rights holder tools page</a> (also available through a link at the bottom of every page). Contact us at support@gluejar.com if you need any help.
{% endifequal %}
{% ifequal claim.status 'pending' %}
The claim will be examined, and we'll email you. Contact us at support@gluejar.com if you need any help.
{% endifequal %}
{% ifequal claim.status 'release' %}
The claim has been released. Contact us at rights@gluejar.com if you have questions.
{% endifequal %}
{% endblock %}

View File

@ -0,0 +1 @@
{{ claim.rights_holder }}'s claim to {{ claim.work }} is now {{ claim.status }}

View File

@ -1,13 +0,0 @@
Congratulations! Your claim to {{ claim.work }} on Unglue.it has been approved.
You are now free to run a campaign to unglue your work. If you're logged in, you will see the option to open a campaign at https://{{ current_site.domain }}/rightsholders . (You can also find this page by clicking on "Rights Holder Tools" at the bottom of any Unglue.it page.)
To run a campaign, you'll need to select a target price and a deadline. You'll also need to write a pitch. This will appear in the Description tab on your book's page (https://{{ current_site.domain }}{% url work claim.work.id %}). Think about who your book's audience is, and remind them why they love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. Feel free to email us (rights@gluejar.com) if you need any help with this.
You should also come up with some custom premiums to reward ungluers for supporting your book. Again, we can help you if you need ideas for what these should be or how to price them.
Finally, think about how you're going to publicize your campaign: social media, newsletters, media contacts, professional organizations, et cetera. Have a plan for how to reach out to these potential supporters before you launch your campaign. Your supporters' sense of connection with you and your book is key to your campaign's success. Again, email us if you'd like help.
We're thrilled to be working with you.
The Unglue.it team

View File

@ -1,13 +0,0 @@
{% extends "notification/notice_template.html" %}
{% block comments_book %}
<a href="{% url work claim.work.id %}"><img src="{{ claim.work.cover_image_small }}" alt="cover image for {{ claim.work.title }}" /></a>
{% endblock %}
{% block comments_graphical %}
Congratulations! Your claim to {{ claim.work.title }} has been approved.
{% endblock %}
{% block comments_textual %}
You are now free to run campaigns for this work. See your email for full details. Then get started on the <a href="/rightsholders/">rights holder tools page</a> (also available through a link at the bottom of every page). Contact us if you need any help.
{% endblock %}

View File

@ -1 +0,0 @@
Congratulations! Your claim to {{ claim.work }} has been approved.