コード例 #1
0
ファイル: drips.py プロジェクト: siphoncode/django-drip
 def body(self):
     if not self._body and self.drip_base.body_template:
         body = Template(self.drip_base.body_template).render(self.context)
         if self.drip_base.drip_model.marketing is True:
             c = Subscription.for_user(self.user).unsubscribe_code
             link = 'https://getsiphon.com/drip/unsubscribe/?code=%s' % c
             body += '<br /><br /><a href="%s">Unsubscribe from future emails</a>' % link
         self._body = body
     return self._body
コード例 #2
0
ファイル: drips.py プロジェクト: dwightgunning/django-drip
 def body(self):
     if not self._body and self.drip_base.body_template:
         body = Template(self.drip_base.body_template).render(self.context)
         if self.drip_base.drip_model.marketing is True:
             c = Subscription.for_user(self.user).unsubscribe_code
             link = 'https://getsiphon.com/drip/unsubscribe/?code=%s' % c
             body += '<br /><br /><a href="%s">Unsubscribe from future emails</a>' % link
         self._body = body
     return self._body
コード例 #3
0
ファイル: drips.py プロジェクト: codyparker/django-drip
 def body(self):
     if not self._body:
         body = Template(self.drip_base.body_template).render(self.context)
         if self.drip_base.drip_model.marketing is True:
             body += '\n\n'
             body += '------------------------------' * 2
             c = Subscription.for_user(self.user).unsubscribe_code
             link = 'https://getsiphon.com/drip/unsubscribe/?code=%s' % c
             body += '\n\n** Unsubscribe: %s' % link
         self._body = body
     return self._body
コード例 #4
0
 def body(self):
     if not self._body:
         body = Template(self.drip_base.body_template).render(self.context)
         if self.drip_base.drip_model.marketing is True:
             body += '\n\n'
             body += '------------------------------' * 2
             c = Subscription.for_user(self.user).unsubscribe_code
             link = 'https://getsiphon.com/drip/unsubscribe/?code=%s' % c
             body += '\n\n** Unsubscribe: %s' % link
         self._body = body
     return self._body
コード例 #5
0
ファイル: drips.py プロジェクト: dwightgunning/django-drip
 def plain(self):
     if not self._plain:
         plain = Template(self.drip_base.plain_template).render(self.context)
         if self.drip_base.drip_model.marketing is True:
             plain += '\n\n'
             plain += '-----------------------------'
             c = Subscription.for_user(self.user).unsubscribe_code
             link = 'https://getsiphon.com/drip/unsubscribe/?code=%s' % c
             plain += '\n\n** Unsubscribe: %s' % link
         self._plain = plain
     return self._plain
コード例 #6
0
ファイル: views.py プロジェクト: siphoncode/django-drip
    def get(self, request):
        c = request.GET.get('code')
        if not c:
            raise Http404('Sorry, this unsubscribe link is not valid.')
        sub = Subscription.for_unsubscribe_code(c)
        if sub is None:
            raise Http404('Unknown unsubscribe code.')

        sub.unsubscribed = True
        sub.save()
        return HttpResponse('Unsubscribed! You will no longer receive these ' \
                            'emails from us.')
コード例 #7
0
ファイル: drips.py プロジェクト: siphoncode/django-drip
 def plain(self):
     if not self._plain:
         plain = Template(self.drip_base.plain_template).render(
             self.context)
         if self.drip_base.drip_model.marketing is True:
             plain += '\n\n'
             plain += '-----------------------------'
             c = Subscription.for_user(self.user).unsubscribe_code
             link = 'https://getsiphon.com/drip/unsubscribe/?code=%s' % c
             plain += '\n\n** Unsubscribe: %s' % link
         self._plain = plain
     return self._plain
コード例 #8
0
ファイル: views.py プロジェクト: dwightgunning/django-drip
    def get(self, request):
        c = request.GET.get('code')
        if not c:
            raise Http404('Sorry, this unsubscribe link is not valid.')
        sub = Subscription.for_unsubscribe_code(c)
        if sub is None:
            raise Http404('Unknown unsubscribe code.')

        sub.unsubscribed = True
        sub.save()
        return HttpResponse('Unsubscribed! You will no longer receive these ' \
                            'emails from us.')