Пример #1
0
Файл: mails.py Проект: sc0Vu/web
def new_bounty(bounty, to_emails=[]):
    if not bounty or not bounty.value_in_usdt:
        return

    subject = "⚡️ New Funded Issue Worth ${}".format(bounty.value_in_usdt)

    for to_email in to_emails:
        from_email = settings.CONTACT_EMAIL
        html, text = render_new_bounty(to_email, bounty)

        if not should_suppress_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Пример #2
0
Файл: mails.py Проект: sc0Vu/web
def new_bounty_acceptance(bounty, to_emails=[]):
    if not bounty or not bounty.value_in_usdt:
        return

    subject = "🌈 Funds Paid! 🌈"

    for to_email in to_emails:
        from_email = settings.CONTACT_EMAIL
        html, text = render_new_bounty_acceptance(to_email, bounty)

        if not should_suppress_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Пример #3
0
Файл: mails.py Проект: sc0Vu/web
def new_bounty_rejection(bounty, to_emails=[]):
    if not bounty or not bounty.value_in_usdt:
        return

    subject = "😕 Claim Rejected 😕"

    for to_email in to_emails:
        from_email = settings.CONTACT_EMAIL
        html, text = render_new_bounty_rejection(to_email, bounty)

        if not should_suppress_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Пример #4
0
Файл: mails.py Проект: sc0Vu/web
def new_bounty_claim(bounty, to_emails=[]):
    if not bounty or not bounty.value_in_usdt:
        return

    subject = "✉️ New Claim Inside ✉️"

    for to_email in to_emails:
        from_email = settings.CONTACT_EMAIL
        html, text = render_new_bounty_claim(to_email, bounty)

        if not should_suppress_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Пример #5
0
Файл: mails.py Проект: sc0Vu/web
def weekly_roundup(to_emails=[]):

    subject = "⚡️ Refer a Friend get ETH (bonus: Pilot Projects update)"
    for to_email in to_emails:
        html, text = render_new_bounty_roundup(to_email)
        from_email = settings.PERSONAL_CONTACT_EMAIL

        if not should_suppress_email(to_email):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      from_name="Kevin Owocki (Gitcoin.co)")
Пример #6
0
Файл: mails.py Проект: sc0Vu/web
def bounty_expire_warning(bounty, to_emails=[]):
    if not bounty or not bounty.value_in_usdt:
        return

    for to_email in to_emails:
        unit = 'days'
        num = int(round((bounty.expires_date - timezone.now()).days, 0))
        if num == 0:
            unit = 'hours'
            num = int(
                round(
                    (bounty.expires_date - timezone.now()).seconds / 3600 / 24,
                    0))
        subject = "😕 Your Funded Issue ({}) Expires In {} {} ... 😕".format(
            bounty.title_or_desc, num, unit)

        from_email = settings.CONTACT_EMAIL
        html, text = render_bounty_expire_warning(to_email, bounty)

        if not should_suppress_email(to_email):
            send_mail(from_email, to_email, subject, text, html)