示例#1
0
文件: event.py 项目: pellaeon/pretix
 def get_mail_backend(self, force_custom=False):
     if self.settings.smtp_use_custom or force_custom:
         return CustomSMTPBackend(host=self.settings.smtp_host,
                                  port=self.settings.smtp_port,
                                  username=self.settings.smtp_username,
                                  password=self.settings.smtp_password,
                                  use_tls=self.settings.smtp_use_tls,
                                  use_ssl=self.settings.smtp_use_ssl,
                                  fail_silently=False)
     else:
         return get_connection(fail_silently=False)
示例#2
0
 def get_mail_backend(self, force_custom=False):
     """
     Returns an email server connection, either by using the system-wide connection
     or by returning a custom one based on the event's settings.
     """
     if self.settings.smtp_use_custom or force_custom:
         return CustomSMTPBackend(host=self.settings.smtp_host,
                                  port=self.settings.smtp_port,
                                  username=self.settings.smtp_username,
                                  password=self.settings.smtp_password,
                                  use_tls=self.settings.smtp_use_tls,
                                  use_ssl=self.settings.smtp_use_ssl,
                                  fail_silently=False)
     else:
         return get_connection(fail_silently=False)
示例#3
0
    def get_mail_backend(self, timeout=None, force_custom=False):
        """
        Returns an email server connection, either by using the system-wide connection
        or by returning a custom one based on the organizer's settings.
        """
        from pretix.base.email import CustomSMTPBackend

        if self.settings.smtp_use_custom or force_custom:
            return CustomSMTPBackend(host=self.settings.smtp_host,
                                     port=self.settings.smtp_port,
                                     username=self.settings.smtp_username,
                                     password=self.settings.smtp_password,
                                     use_tls=self.settings.smtp_use_tls,
                                     use_ssl=self.settings.smtp_use_ssl,
                                     fail_silently=False,
                                     timeout=timeout)
        else:
            return get_connection(fail_silently=False)