Esempio n. 1
0
def new_feedback(email, feedback):
    to_email = '*****@*****.**'
    from_email = settings.SERVER_EMAIL
    subject = "New Feedback"
    body = f"New feedback from {email}: {feedback}"
    if not should_suppress_notification_email(to_email, 'admin'):
        send_mail(
            from_email,
            to_email,
            subject,
            body,
            from_name="No Reply from Gitcoin.co",
            categories=['admin', func_name()],
        )
Esempio n. 2
0
File: mails.py Progetto: step21/web
def weekly_roundup(to_emails=[]):

    subject = "Gitcoin.co + CodeSponsor.io = ๐Ÿ”ฅ"
    for to_email in to_emails:
        html, text = render_new_bounty_roundup(to_email)
        from_email = settings.PERSONAL_CONTACT_EMAIL

        if not should_suppress_notification_email(to_email):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      from_name="Kevin Owocki (Gitcoin.co)")
Esempio n. 3
0
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_notification_email(to_email):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      from_name="Kevin Owocki (Gitcoin.co)")
Esempio n. 4
0
def bounty_startwork_expired(to_email, bounty, interest, time_delta_days):
    if not bounty or not bounty.value_in_usdt_now:
        return
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        from_email = settings.CONTACT_EMAIL
        html, text = render_bounty_startwork_expire_warning(to_email, bounty, interest, time_delta_days)
        subject = gettext("We've removed you from the task: '{}' ? ").format(bounty.title_or_desc)

        if not should_suppress_notification_email(to_email, 'bounty_expiration'):
            send_mail(from_email, to_email, subject, text, html, categories=['transactional', func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 5
0
def weekly_roundup(to_emails=[]):

    subject = "Gitcoin Weekly | Gitcoin Now Easily Integrates w. Github - Chrome Extension Enters Beta"
    for to_email in to_emails:
        html, text = render_new_bounty_roundup(to_email)
        from_email = settings.PERSONAL_CONTACT_EMAIL

        if not should_suppress_notification_email(to_email):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      from_name="Kevin Owocki (Gitcoin.co)")
Esempio n. 6
0
def new_bounty(bounty, to_emails=None):
    if not bounty or not bounty.value_in_usdt:
        return

    if to_emails is None:
        to_emails = []

    subject = "โšก๏ธ New Funded Issue Match worth ${} ({})".format(bounty.value_in_usdt, bounty.keywords)

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

        if not should_suppress_notification_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Esempio n. 7
0
def new_supporter(grant, subscription):
    from_email = settings.CONTACT_EMAIL
    to_email = grant.admin_profile.email
    if not to_email:
        to_email = grant.admin_profile.user.email
    cur_language = translation.get_language()

    try:
        setup_lang(to_email)
        html, text, subject = render_new_supporter_email(grant, subscription)

        if not should_suppress_notification_email(to_email, 'new_supporter'):
            send_mail(from_email, to_email, subject, text, html, categories=['transactional', func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 8
0
File: mails.py Progetto: ethikz/web
def new_bounty_rejection(bounty, to_emails=None):
    if not bounty or not bounty.value_in_usdt:
        return

    if to_emails is None:
        to_emails = []

    subject = "๐Ÿ˜• Fulfillment Rejected for {} ๐Ÿ˜•".format(bounty.title_or_desc)

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

        if not should_suppress_notification_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Esempio n. 9
0
def new_work_submission(bounty, to_emails=None):
    if not bounty or not bounty.value_in_usdt:
        return

    if to_emails is None:
        to_emails = []

    subject = "โœ‰๏ธ New Work Submission Inside for {} โœ‰๏ธ".format(bounty.title_or_desc)

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

        if not should_suppress_notification_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Esempio n. 10
0
def new_bounty_acceptance(bounty, to_emails=None):
    if not bounty or not bounty.value_in_usdt:
        return

    if to_emails is None:
        to_emails = []

    subject = "๐ŸŒˆ Funds Paid for {} ๐ŸŒˆ".format(bounty.title_or_desc)

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

        if not should_suppress_notification_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Esempio n. 11
0
def thank_you_for_supporting(grant, subscription):
    from_email = settings.CONTACT_EMAIL
    to_email = subscription.contributor_profile.email
    if not to_email:
        to_email = subscription.contributor_profile.user.email
    cur_language = translation.get_language()

    try:
        setup_lang(to_email)
        html, text, subject = render_thank_you_for_supporting_email(grant, subscription)

        if not should_suppress_notification_email(to_email, 'thank_you_for_supporting'):
            send_mail(from_email, to_email, subject, text, html, categories=['transactional', func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 12
0
def gdpr_update(to_emails=None):
    if to_emails is None:
        to_emails = []

    for to_email in to_emails:
        cur_language = translation.get_language()
        try:
            setup_lang(to_email)
            html, text, subject = render_gdpr_update(to_email)
            from_email = settings.PERSONAL_CONTACT_EMAIL

            if not should_suppress_notification_email(to_email, 'roundup'):
                send_mail(from_email, to_email, subject, text, html, from_name="Kevin Owocki (Gitcoin.co)")
        finally:
            translation.activate(cur_language)
Esempio n. 13
0
File: mails.py Progetto: ethikz/web
def weekly_roundup(to_emails=None):
    if to_emails is None:
        to_emails = []

    subject = "Gitcoin + Standard Bounties = ๐Ÿ”ฅ"
    for to_email in to_emails:
        html, text = render_new_bounty_roundup(to_email)
        from_email = settings.PERSONAL_CONTACT_EMAIL

        if not should_suppress_notification_email(to_email):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      from_name="Kevin Owocki (Gitcoin.co)")
Esempio n. 14
0
def weekly_roundup(to_emails=None):
    if to_emails is None:
        to_emails = []

    subject = "Gitcoin Weekly | Product Designer Alisa March Joins the Team"
    for to_email in to_emails:
        html, text = render_new_bounty_roundup(to_email)
        from_email = settings.PERSONAL_CONTACT_EMAIL

        if not should_suppress_notification_email(to_email):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      from_name="Kevin Owocki (Gitcoin.co)")
Esempio n. 15
0
def new_bounty(bounty, to_emails=None):
    if not bounty or not bounty.value_in_usdt:
        return

    if to_emails is None:
        to_emails = []

    subject = f"โšก๏ธ New Funded Issue Match worth {bounty.value_in_usdt} USD @ " \
              f"${convert_token_to_usdt(bounty.token_name)}/{bounty.token_name} {bounty.keywords})"

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

        if not should_suppress_notification_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Esempio n. 16
0
def new_bounty_rejection(bounty, to_emails=None):
    if not bounty or not bounty.value_in_usdt_now:
        return

    subject = gettext("๐Ÿ˜• Work Submission Rejected for {} ๐Ÿ˜•").format(
        bounty.title_or_desc)

    if to_emails is None:
        to_emails = []

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

        if not should_suppress_notification_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Esempio n. 17
0
def new_external_bounty():
    """Send a new external bounty email notification."""
    to_email = settings.PERSONAL_CONTACT_EMAIL
    from_email = settings.SERVER_EMAIL
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        subject = _("New External Bounty")
        body = f"https://gitcoin.co/_administrationexternal_bounties/externalbounty"
        if not should_suppress_notification_email(to_email, 'admin'):
            send_mail(from_email,
                      to_email,
                      subject,
                      body,
                      from_name=_("No Reply from Gitcoin.co"))
    finally:
        translation.activate(cur_language)
Esempio n. 18
0
def warn_account_out_of_eth(account, balance, denomination):
    to_email = settings.PERSONAL_CONTACT_EMAIL
    from_email = settings.SERVER_EMAIL
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        subject = account + str(_(" is out of gas"))
        body_str = _("is down to ")
        body = f"{account } {body_str} {balance} {denomination}"
        if not should_suppress_notification_email(to_email, 'admin'):
            send_mail(from_email,
                      to_email,
                      subject,
                      body,
                      from_name=_("No Reply from Gitcoin.co"))
    finally:
        translation.activate(cur_language)
Esempio n. 19
0
def bounty_startwork_expire_warning(to_email, bounty, interest,
                                    time_delta_days):
    if not bounty or not bounty.value_in_usdt_now:
        return
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        from_email = settings.CONTACT_EMAIL
        html, text = render_bounty_startwork_expire_warning(
            to_email, bounty, interest, time_delta_days)
        subject = gettext("Are you still working on '{}' ? ").format(
            bounty.title_or_desc)

        if not should_suppress_notification_email(to_email, 'transactional'):
            send_mail(from_email, to_email, subject, text, html)
    finally:
        translation.activate(cur_language)
Esempio n. 20
0
def start_work_rejected(interest, bounty):
    from_email = settings.CONTACT_EMAIL
    to_email = interest.profile.email
    if not to_email:
        if interest.profile and interest.profile.user:
            to_email = interest.profile.user.email
    if not to_email:
        return
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        html, text, subject = render_start_work_rejected(interest, bounty)

        if not should_suppress_notification_email(to_email, 'bounty'):
            send_mail(from_email, to_email, subject, text, html, categories=['transactional', func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 21
0
def new_reserved_issue(from_email, user, bounty):
    to_email = user.email
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        html, text, subject = render_reserved_issue(to_email, user, bounty)

        if not should_suppress_notification_email(to_email, 'bounty'):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      categories=['transactional',
                                  func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 22
0
def featured_funded_bounty(from_email, bounty):
    to_email = bounty.bounty_owner_email
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        html, text, subject = render_featured_funded_bounty(bounty)

        if not should_suppress_notification_email(to_email,
                                                  'featured_funded_bounty'):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      categories=['transactional',
                                  func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 23
0
def start_work_new_applicant(interest, bounty):
    from_email = settings.CONTACT_EMAIL
    to_email = bounty.bounty_owner_email
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        html, text, subject = render_start_work_new_applicant(interest, bounty)

        if not should_suppress_notification_email(to_email, 'bounty'):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      categories=['transactional',
                                  func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 24
0
def change_grant_owner_reject(grant, profile):
    from_email = settings.CONTACT_EMAIL
    to_email = profile.email
    if not to_email:
        if profile and profile.user:
            to_email = profile.user.email
    if not to_email:
        return
    cur_language = translation.get_language()

    try:
        setup_lang(to_email)
        html, text, subject = render_change_grant_owner_reject(grant)

        if not should_suppress_notification_email(to_email, 'change_owner'):
            send_mail(from_email, to_email, subject, text, html, categories=['transactional', func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 25
0
def bounty_expire_warning(bounty, to_emails=[]):
    if not bounty or not bounty.value_in_usdt:
        return

    for to_email in to_emails:
        unit = 'day'
        num = int(round((bounty.expires_date - timezone.now()).days, 0))
        if num == 0:
            unit = 'hour'
            num = int(round((bounty.expires_date - timezone.now()).seconds / 3600 / 24, 0))
        unit = unit + ("s" if num != 1 else "")
        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_notification_email(to_email):
            send_mail(from_email, to_email, subject, text, html)
Esempio n. 26
0
def reject_faucet_request(fr):
    from_email = settings.SERVER_EMAIL
    subject = _("Faucet Request Rejected")
    to_email = fr.email
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        html, text = render_faucet_rejected(fr)
        if not should_suppress_notification_email(to_email, 'faucet'):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      categories=['transactional',
                                  func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 27
0
def new_token_request(obj):
    to_email = settings.PERSONAL_CONTACT_EMAIL
    from_email = settings.SERVER_EMAIL
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        subject = _("New Token Request")
        body_str = _(
            "A new token request was completed. You may fund the token request here"
        )
        body = f"{body_str}: https://gitcoin.co/{obj.admin_url} \n\n {obj.email}"
        if not should_suppress_notification_email(to_email, 'faucet'):
            send_mail(from_email,
                      to_email,
                      subject,
                      body,
                      from_name=_("No Reply from Gitcoin.co"))
    finally:
        translation.activate(cur_language)
Esempio n. 28
0
def bounty_uninterested(to_email, bounty, interest):
    from_email = settings.CONTACT_EMAIL
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        html, text = render_bounty_unintersted(to_email, bounty, interest)
        subject = "Funder has removed you from the task: '{}' ? ".format(
            bounty.title_or_desc)

        if not should_suppress_notification_email(to_email, 'bounty'):
            send_mail(from_email,
                      to_email,
                      subject,
                      text,
                      html,
                      categories=['transactional',
                                  func_name()])
    finally:
        translation.activate(cur_language)
Esempio n. 29
0
def bounty_feedback(bounty, persona='fulfiller', previous_bounties=[]):
    from_email = settings.PERSONAL_CONTACT_EMAIL
    to_email = None
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        if persona == 'fulfiller':
            accepted_fulfillments = bounty.fulfillments.filter(accepted=True)
            to_email = accepted_fulfillments.first().fulfiller_email if accepted_fulfillments.exists() else ""
        elif persona == 'funder':
            to_email = bounty.bounty_owner_email

        subject = bounty.github_url
        html, text = render_bounty_feedback(bounty, persona, previous_bounties)
        cc_emails = [from_email, '*****@*****.**']
        if not should_suppress_notification_email(to_email, 'bounty_feedback'):
            send_mail(from_email, to_email, subject, text, cc_emails=cc_emails, from_name="Kevin Owocki (Gitcoin.co)")
    finally:
        translation.activate(cur_language)
Esempio n. 30
0
def warn_subscription_failed(subscription):
    to_email = settings.PERSONAL_CONTACT_EMAIL
    from_email = settings.SERVER_EMAIL
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)
        subject = str(subscription.pk) + str(_(" subscription failed"))
        body = f"{settings.BASE_URL}{subscription.admin_url }\n{subscription.contributor_profile.email}, {subscription.contributor_profile.user.email}<pre>\n\n{subscription.subminer_comments}</pre>"
        if not should_suppress_notification_email(to_email, 'admin'):
            send_mail(
                from_email,
                to_email,
                subject,
                body,
                from_name=_("No Reply from Gitcoin.co"),
                categories=['admin', func_name()],
            )
    finally:
        translation.activate(cur_language)