Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Grants txn Failed Email #6791

Merged
merged 7 commits into from
Jun 23, 2020

Conversation

sebastiantf
Copy link
Contributor

Description

This PR builds a new email to notify Grants contributors if their contribution txns have failed

Refers/Fixes

Fixes #6556

Testing

Gmail Web:

grants_txn_failed_email_gmail_web

Gmail Mobile:

grants_txn_failed_email_gmail_mobile

Web Preview:

grants_txn_failed_email_web_preview

@codecov
Copy link

codecov bot commented Jun 6, 2020

Codecov Report

Merging #6791 into master will decrease coverage by 0.44%.
The diff coverage is 7.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6791      +/-   ##
==========================================
- Coverage   26.92%   26.48%   -0.45%     
==========================================
  Files         295      299       +4     
  Lines       28279    28829     +550     
  Branches     4146     4226      +80     
==========================================
+ Hits         7615     7636      +21     
- Misses      20390    20922     +532     
+ Partials      274      271       -3     
Impacted Files Coverage Δ
app/app/urls.py 86.20% <ø> (ø)
...oard/management/commands/grant_txn_failed_email.py 0.00% <0.00%> (ø)
app/marketing/mails.py 10.94% <6.66%> (-0.06%) ⬇️
app/retail/emails.py 21.36% <20.00%> (-0.02%) ⬇️
app/grants/clr.py 0.00% <0.00%> (-18.05%) ⬇️
app/dashboard/tasks.py 33.33% <0.00%> (-3.16%) ⬇️
app/economy/tx.py 17.70% <0.00%> (-2.30%) ⬇️
app/grants/models.py 45.67% <0.00%> (-1.97%) ⬇️
app/dashboard/admin.py 64.73% <0.00%> (-1.36%) ⬇️
app/grants/admin.py 42.93% <0.00%> (-0.78%) ⬇️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b76d0f...e444c77. Read the comment docs.

@frankchen07
Copy link
Contributor

design looks great.

what are the specific cases where someone would get sent this email?

  1. gas too low, txn pending forever
  2. not enough gas, txn fails
  3. what else?

@owocki
Copy link
Contributor

owocki commented Jun 8, 2020

  1. gas too low, txn pending forever
  2. not enough gas, txn fails
  3. not enough tokens, txn fails
  4. some other contract error (this seems to happen a lot with USDC)
  5. other

@owocki
Copy link
Contributor

owocki commented Jun 8, 2020

@frankchen07 i take it u think we should highlight why the contribs failed and recommend a remeditation step?

for pending tx the remeditation step is diff than the 'failed' step

@frankchen07
Copy link
Contributor

sorry, missed this, yes I think having a more detailed explanation might be good, but it'll depend on how complicated it is to pull that information. usually I just go to etherscan and its a quick google to figure things out.

@owocki
Copy link
Contributor

owocki commented Jun 16, 2020

ahh merge conflicts... poo. @sebastiantf can you fix!??

@sebastiantf sebastiantf force-pushed the grants-txn-failed-email branch from 20b2b76 to 2f60d92 Compare June 17, 2020 06:10
@sebastiantf
Copy link
Contributor Author

@owocki I have rebased and fixed merge conflicts

@owocki
Copy link
Contributor

owocki commented Jun 22, 2020

@danlipert @thelostone-mc can this get into the next release pls? 🙏

.grant-txn-msg {
width: 60%;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ could we move this to the needed email files!
Else it would be imported by every mail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thelostone-mc Gmail seems to have an issue while using media queries in emails. It only considers the first set of media queries it sees and ignores media queries seen anywhere else afterwards. I found this behaviour while working on the daily email redesign and also found on the Internet that others have experienced this behaviour too.

The workaround is to include all the media queries in the first place (first <style> tag) and that would be the one in template.html. This is why the media queries and the corresponding styles are all placed in template.html itself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that makes sense !
But if by placing it here, wouldn't every other email which has media query styles not be applied (not sure if there are other mails which get affected by this )

If we are doing this, we should collect it from all emails and add that in

Could we move these though into the grant specific mail ?

  .etherscan-link {
    display: inline-block;
    font-family: 'Muli', sans-serif;
    color: #3E00FF;
  }

  .grant-txn-msg, .grant-txn-id {
    margin: 0 auto;
  }

  .grant-txn-id a {
    overflow-wrap: break-word;
  }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that makes sense !
But if by placing it here, wouldn't every other email which has media query styles not be applied (not sure if there are other mails which get affected by this )

If we are doing this, we should collect it from all emails and add that in

Could we move these though into the grant specific mail ?

  .etherscan-link {
    display: inline-block;
    font-family: 'Muli', sans-serif;
    color: #3E00FF;
  }

  .grant-txn-msg, .grant-txn-id {
    margin: 0 auto;
  }

  .grant-txn-id a {
    overflow-wrap: break-word;
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move these though into the grant specific mail ?

  .etherscan-link {
    display: inline-block;
    font-family: 'Muli', sans-serif;
    color: #3E00FF;
  }

  .grant-txn-msg, .grant-txn-id {
    margin: 0 auto;
  }

  .grant-txn-id a {
    overflow-wrap: break-word;
  }

@thelostone-mc Done in e444c77

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that makes sense !
But if by placing it here, wouldn't every other email which has media query styles not be applied (not sure if there are other mails which get affected by this )

If we are doing this, we should collect it from all emails and add that in

I do doubt that the media query styles present inside specific email templates are actually being rendered correctly by Gmail. That may have to be tested and taken care of. But the commits in this PR wont affect the other emails.

</div>

<div style="margin-bottom: 3em; margin-top: 3em;">
<a class="button" href="#">{% trans "Resubmit Transaction" %}</a> <!-- TODO: Replace correct href to add the failed grant to cart -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be fixed , the least we can do is link them to the grant so that they can add it themselves

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owocki any suggestions? Maybe use the bulk-add link?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this needs to be updated before we deploy I think - @sebastiantf I think the bulk add link would be perfect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments

params = {
'grant_title': grant.title,
'tx_id': tx_id,
'tx_url': "https://etherscan.io/tx/"+tx_id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for the future: we'll have to update this to use other block explorers once we support other chains

</div>

<div style="margin-bottom: 3em; margin-top: 3em;">
<a class="button" href="#">{% trans "Resubmit Transaction" %}</a> <!-- TODO: Replace correct href to add the failed grant to cart -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this needs to be updated before we deploy I think - @sebastiantf I think the bulk add link would be perfect

@danlipert danlipert marked this pull request as draft June 23, 2020 08:43
@sebastiantf sebastiantf marked this pull request as ready for review June 23, 2020 12:20
@owocki
Copy link
Contributor

owocki commented Jun 23, 2020

@sebastiantf can you revert the engineers feedback? i want to get this in ASAP since theres an ongoing grants round right now

@thelostone-mc thelostone-mc changed the base branch from master to stable June 23, 2020 13:56
@owocki
Copy link
Contributor

owocki commented Jun 23, 2020

:shipit: :shipit: :shipit:

@thelostone-mc thelostone-mc merged commit 997673e into gitcoinco:stable Jun 23, 2020
@sebastiantf
Copy link
Contributor Author

@sebastiantf can you revert the engineers feedback? i want to get this in ASAP since theres an ongoing grants round right now

@owocki Sorry I'm late. But I'm not sure I understand what you meant by 'engineers feedback'. Would you mind explaining?

@owocki
Copy link
Contributor

owocki commented Jun 23, 2020 via email

octavioamu added a commit that referenced this pull request Jun 24, 2020
* Fix Firefox issue that showed red border for decimal inputs in cart (#6958)

* New Grants txn Failed Email (#6791)

* setup web preview url

* implement render_grant_txn_failed

* build template grant_txn_failed.html

* management command for grant_txn_failed_email

* fix missing returns after resolving conflicts

* add bulk_add_url

* move email specific style to grant_txn_failed.html

* new approval checker helper script

* fix comparing strings on allowance

* fix featured bounty and balance checker

* fix eslint card.js

* Improve cart gas estimates for DAI, aDAI, cDAI, and ANT (#6961)

* Quotation on Profile handle (#6957)

* Improve cart gas estimates for DAI, aDAI, cDAI, and ANT

Co-authored-by: Paul <[email protected]>

* wallet improvments (#6952)

* wallet improvments

* avoid form submission

* bounty requesting wallet

* quest js dupe

* Fix for bottomVisible method scope. (#6964)

* fix for projects, the bottomVisible method was defined incorrectly

* fixes for paginaiton of projects, as well as sorting by winners as default

* restoring docker-compose

* Update manifest.json

reverting manifest changes

* Update top_nav.html

revert top nav changes

* position the loading screen better inside the project directory

* formalizes the types of conversion rates in the DB

* 1 thing

* fixes A few annoying
things about kudso

1. now proudly shows the kudos artist
2. allows u to mind them in one fell swoop + change onwnership
3. stores the IPFS metadata in our DB for future keeping

Co-authored-by: Matt <[email protected]>
Co-authored-by: Sebastian T F <[email protected]>
Co-authored-by: Owocki <[email protected]>
Co-authored-by: Paul <[email protected]>
Co-authored-by: Andrew Redden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants