예제 #1
0
 def get_target(self, mail):
     """
     gets the link target by evaluating the string using the email content
     """
     from pennyblack.models import Newsletter
     if self.identifier != '':
         return Newsletter.get_view_link(self.identifier)
     template = Template(self.link_target)
     return template.render(Context(mail.get_context()))
예제 #2
0
파일: link.py 프로젝트: fiee/pennyblack
 def get_target(self, mail):
     """
     gets the link target by evaluating the string using the email content
     """
     from pennyblack.models import Newsletter
     if self.identifier != '':
         return Newsletter.get_view_link(self.identifier)
     template = Template(self.link_target)
     return template.render(Context(mail.get_context()))
예제 #3
0
파일: link.py 프로젝트: satadev/pennyblack
 def get_target_for_job(self, job):
     """
     gets the link target by evaluating the string using the email content
     """
     from pennyblack.models import Newsletter, Mail
     if self.identifier != '':
         return Newsletter.get_view_link(self.identifier)
     template = Template(self.link_target)
     # make a fake mail context, since there's no actual mail here
     mail = Mail(job=job)
     return template.render(Context(mail.get_context()))