示例#1
0
 def send_mail_test(self, request, queryset):
     if Contact.objects.testers():
         for newsletter in queryset:
             mailer = Mailer(newsletter, test=True)
             try:
                 mailer.run()
             except HTMLParseError:
                 self.message_user(request, _(u'newsletter send failed, HTML has errors.'))
                 continue
             self.message_user(request, _(u'test sent successfully'))
     else:
         self.message_user(request, _(u'There are no test contacts registered.' ))