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

Add 'Voucher:' before voucher code on order confirmation emails #12998

Conversation

kernal053
Copy link
Contributor

@kernal053 kernal053 commented Nov 26, 2024

What? Why?

What should we test?

  • When voucher is used in an order as a shopper, order confirmation email will contain "Voucher:" text before voucher code.
  • Check also for translated "Voucher" text.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

Preview (en)

Screenshot 2024-12-04 at 10 02 08 PM

Preview (es)

Screenshot 2024-12-04 at 10 02 52 PM

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Nice! Thank you.

I have a suggestion below. Are you up for that?

app/views/spree/order_mailer/_order_summary.html.haml Outdated Show resolved Hide resolved
@mkllnk mkllnk added the user facing changes Thes pull requests affect the user experience label Nov 29, 2024
@kernal053 kernal053 force-pushed the add-voucher-to-order-confirmation-emails branch from 2097d0c to 7c0fa56 Compare December 4, 2024 16:11
Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

Thanks, that's a good solution.

But actually we prefer not to change all the locale files, only en.yml. All other files are managed with Transifex and shouldn't be updated directly, so this could cause conflicts. Could you please remove those changes?

For reference:
https://github.com/openfoodfoundation/openfoodnetwork/wiki/Internationalisation-%28i18n%29#development

Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Nice one 👍 Thanks @kernal053 🙏

Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

Thankyou!

Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

Hmm, sorry I didn't notice this earlier, but this will hide any adjustments that are not of type "Voucher".
I'm not sure, but I think other adjustments such as Enterprise Fees or tax might appear here.

If so, it would be worth adding a spec here: https://guide.openfoodnetwork.org/basic-features/shopfront/enterprise-fees

Are you willing to look into this?

@kernal053
Copy link
Contributor Author

Apologies, I overlook other adjustments. Will fix the code. Right now, we're only excluding LineItem adjustable. Thereby, not displaying enterprise fees.

And adding spec, I think order_mailer_spec.rb needs to be updated. I couldn't get around your message regarding it. I guess you meant to mention specific spec file.

@dacook
Copy link
Member

dacook commented Dec 9, 2024

Thanks for looking back into this.

And adding spec, I think order_mailer_spec.rb needs to be updated. I couldn't get around your message regarding it. I guess you meant to mention specific spec file.

I'm sorry, I pasted the wrong link. You're right, it was meant to be a link to order_mailer_spec.rb 👍

@kernal053 kernal053 force-pushed the add-voucher-to-order-confirmation-emails branch 3 times, most recently from d2fbfbd to 2f66320 Compare December 10, 2024 15:01
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @kernal053 🙏

Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

Great!

it "includes Shipping label" do
expect(confirmation_email_for_customer.body).to include("Shipping:")
expect(confirmation_email_for_shop.body).to include("Shipping:")
expect(cancellation_email.body).to include("Shipping:")
Copy link
Member

Choose a reason for hiding this comment

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

I see that the shipping fee comes from the factory order_with_totals_and_distribution. Maybe it's worth a comment here explaining that, but never mind :)

@drummer83 drummer83 added the no-staging-AU A tag which does not trigger deployments, indicating a server is being used label Jan 2, 2025
@drummer83 drummer83 self-assigned this Jan 2, 2025
@drummer83 drummer83 force-pushed the add-voucher-to-order-confirmation-emails branch from 2f66320 to bad32e2 Compare January 2, 2025 15:29
@drummer83 drummer83 added pr-staged-au staging.openfoodnetwork.org.au and removed no-staging-AU A tag which does not trigger deployments, indicating a server is being used labels Jan 2, 2025
@mkllnk mkllnk removed the pr-staged-au staging.openfoodnetwork.org.au label Jan 3, 2025
@drummer83 drummer83 added no-staging-AU A tag which does not trigger deployments, indicating a server is being used pr-staged-au staging.openfoodnetwork.org.au and removed no-staging-AU A tag which does not trigger deployments, indicating a server is being used labels Jan 3, 2025
@drummer83
Copy link
Contributor

drummer83 commented Jan 3, 2025

Hi @kernal053,
Thank you so much for working on this. Due to the holiday season it took a while until we got to testing it - I'm sorry for that.

I've tested your PR now and here are the results.

Tested page
Order summary page
Before: grafik After: grafik
Edit cart page
Before: grafik After: grafik
Order confirmation page
Before: grafik After: grafik
Order confirmation email
Before: grafik After: grafik

Results

A few things are worth mentioning.

Summary

Your PR is solving the issue well. I will open new issues to address the remaining two minor things I've found. If you like, feel free to tackle them as well.

Thank you so much again! 🙏
Merging! 🥳 🚀

@drummer83 drummer83 merged commit 35fa415 into openfoodfoundation:master Jan 3, 2025
57 checks passed
@drummer83 drummer83 removed the pr-staged-au staging.openfoodnetwork.org.au label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add "voucher:" before voucher code on order confirmation emails
5 participants