Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

[WIP][GH-4359] fix wrong email notification after leaving review #4426

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fedealconada
Copy link

@fedealconada fedealconada commented Apr 6, 2020

Description:

  • After leaving a review on a product you purchased, you (the buyer) are getting an email that is supposed to be for the seller.
  • Flipping message template logic to the seller side

Fixes 4359

NOTE I've put it in WIP as I'm not sure how I can run marketplace.test.js to see the test passes... Any feedback is welcome!

When buyer gives a review, they is receiving an email notification that is supposed to be for the seller.
@@ -127,6 +133,15 @@ const messageTemplates = {
text: template(
fs.readFileSync(`${templateDir}/seller-OfferFinalized.txt`).toString()
)
},
OfferData: {
Copy link
Contributor

Choose a reason for hiding this comment

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

We have OfferFinalized, OfferCreated, ...Offer[Action]. It would be nice to name this accordingly OfferReviewed or something to that nature.

I would like an Origin team member to weigh in on this before you make any changes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OfferData is event name from our Solidity contracts. Don't think we plan on upgrading the contracts anytime soon. So, I'd suggest to leave it as it is for now.

OfferData: {
subject: template('New Review for <%= listing.title %>'),
mjml: template(
fs.readFileSync(`${templateDir}/buyer-OfferReview.mjml`).toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

These files should get renamed to the seller side

Suggested change
fs.readFileSync(`${templateDir}/buyer-OfferReview.mjml`).toString()
fs.readFileSync(`${templateDir}/seller-OfferReview.mjml`).toString()

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's reasonable. I'd suggest to change it too.

Copy link
Contributor

@franckc franckc Apr 17, 2020

Choose a reason for hiding this comment

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

Unless I'm mistaken, I don't think the template files seller-OfferReview.mjml/txt already exist?
They should be added as part of this PR.

fs.readFileSync(`${templateDir}/buyer-OfferReview.mjml`).toString()
),
text: template(
fs.readFileSync(`${templateDir}/buyer-OfferReview.txt`).toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Suggested change
fs.readFileSync(`${templateDir}/buyer-OfferReview.txt`).toString()
fs.readFileSync(`${templateDir}/seller-OfferReview.txt`).toString()

Copy link
Collaborator

@shahthepro shahthepro left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this @fedealconada and @rembrandtreyes. Looks good to me. But @franckc might want to have a look too.

@@ -127,6 +133,15 @@ const messageTemplates = {
text: template(
fs.readFileSync(`${templateDir}/seller-OfferFinalized.txt`).toString()
)
},
OfferData: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

OfferData is event name from our Solidity contracts. Don't think we plan on upgrading the contracts anytime soon. So, I'd suggest to leave it as it is for now.

OfferData: {
subject: template('New Review for <%= listing.title %>'),
mjml: template(
fs.readFileSync(`${templateDir}/buyer-OfferReview.mjml`).toString()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's reasonable. I'd suggest to change it too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"A review has been left on your transaction" email sent to reviewer
4 participants