예제 #1
0
 def send(recipients, message, **options):
     kwargs = {
         'attachments': attachments,
         'cc': cc,
         'from_email': from_email,
         'headers': headers,
         'html_message': html_message,
         'max_retries': max_retries,
         'real_email': real_email,
         'reply_to': reply_to,
     }
     kwargs.update(options)
     # Email subject *must not* contain newlines
     args = (list(recipients), ' '.join(subject.splitlines()), message)
     return send_email.delay(*args, **kwargs)
예제 #2
0
파일: utils.py 프로젝트: diox/olympia
 def send(recipients, message, **options):
     kwargs = {
         'attachments': attachments,
         'cc': cc,
         'from_email': from_email,
         'headers': headers,
         'html_message': html_message,
         'max_retries': max_retries,
         'real_email': real_email,
         'reply_to': reply_to,
     }
     kwargs.update(options)
     # Email subject *must not* contain newlines
     args = (list(recipients), ' '.join(subject.splitlines()), message)
     return send_email.delay(*args, **kwargs)
예제 #3
0
        kwargs = {
            'async': async,
            'attachments': attachments,
            'cc': cc,
            'fail_silently': fail_silently,
            'from_email': from_email,
            'headers': headers,
            'html_message': html_message,
            'max_retries': max_retries,
            'real_email': real_email,
        }
        kwargs.update(options)
        # Email subject *must not* contain newlines
        args = (recipient, ' '.join(subject.splitlines()), message)
        if async:
            return send_email.delay(*args, **kwargs)
        else:
            return send_email(*args, **kwargs)

    if white_list:
        if perm_setting:
            html_template = loader.get_template('amo/emails/unsubscribe.html')
            text_template = loader.get_template('amo/emails/unsubscribe.ltxt')
            if not manage_url:
                manage_url = urlparams(
                    absolutify(reverse('users.edit', add_prefix=False)),
                    'acct-notify')
            for recipient in white_list:
                # Add unsubscribe link to footer.
                token, hash = UnsubscribeCode.create(recipient)
                unsubscribe_url = absolutify(
예제 #4
0
        kwargs = {
            'async': async,
            'attachments': attachments,
            'cc': cc,
            'fail_silently': fail_silently,
            'from_email': from_email,
            'headers': headers,
            'html_message': html_message,
            'max_retries': max_retries,
            'real_email': real_email,
        }
        kwargs.update(options)
        # Email subject *must not* contain newlines
        args = (recipient, ' '.join(subject.splitlines()), message)
        if async:
            return send_email.delay(*args, **kwargs)
        else:
            return send_email(*args, **kwargs)

    if white_list:
        if perm_setting:
            html_template = loader.get_template('amo/emails/unsubscribe.html')
            text_template = loader.get_template('amo/emails/unsubscribe.ltxt')
            if not manage_url:
                manage_url = urlparams(absolutify(
                    reverse('users.edit', add_prefix=False)),
                    'acct-notify')
            for recipient in white_list:
                # Add unsubscribe link to footer.
                token, hash = UnsubscribeCode.create(recipient)
                unsubscribe_url = absolutify(