<commit_before>from django.conf import settings
from django.core.urlresolvers import reverse

from celery import task, current_task

from toolkit.members.models import Member


@task()
def send_mailout(subject, body):
    header_template = u"Dear {0},\n\n"
    signature_template = (
        u"""

If you wish to be removed from our mailing list please use this link:
http://{0}{{0}}?k={{2}}
To edit details of your membership, please use this link:
http://{0}{{1}}?k={{2}}
""").format(settings.EMAIL_UNSUBSCRIBE_HOST, settings.EMAIL_UNSUBSCRIBE_HOST)

    recipients = (Member.objects.filter(email__isnull=False)
                                .exclude(email='')
                                .exclude(mailout_failed=True)
                                .filter(mailout=True))
    count = recipients.count()
    sent = 0
    one_percent = count // 100 or 1

    if count == 0:
        return (False, 1000, ['blah', 'blah', 'blah'])

    with open("/tmp/spool", "w") as spool:<commit_msg>In member's mailout, corrected association of removal link and edit details link. Marcus.<commit_after>from django.conf import settings
from django.core.urlresolvers import reverse

from celery import task, current_task

from toolkit.members.models import Member


@task()
def send_mailout(subject, body):
    header_template = u"Dear {0},\n\n"
    signature_template = (
        u"""

If you wish to be removed from our mailing list please use this link:
http://{0}{{1}}?k={{2}}
To edit details of your membership, please use this link:
http://{0}{{0}}?k={{2}}
""").format(settings.EMAIL_UNSUBSCRIBE_HOST, settings.EMAIL_UNSUBSCRIBE_HOST)

    recipients = (Member.objects.filter(email__isnull=False)
                                .exclude(email='')
                                .exclude(mailout_failed=True)
                                .filter(mailout=True))
    count = recipients.count()
    sent = 0
    one_percent = count // 100 or 1

    if count == 0:
        return (False, 1000, ['blah', 'blah', 'blah'])

    with open("/tmp/spool", "w") as spool:
{'fraction_non_alphanumeric': 0.12718446601941746, 'fraction_numerical': 0.01650485436893204, 'mean_word_length': 2.7678244972577697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '206538', 'n_tokens_mistral': 666, 'n_tokens_neox': 622, 'n_words': 175}