-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Bring Mailers from Spree and make order shipped email translatable #5763
Conversation
…rder_mailer specs
- if @shipment.tracking_url | ||
= Spree.t('shipment_mailer.shipped_email.track_link', url: @shipment.tracking_url) | ||
|
||
= Spree.t('shipment_mailer.shipped_email.thanks') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure switching from .text to .HTML won't break things? I never investigated this but I think .text is used as a fallback text-version of the email for specific old mail servers/clients. Again, no idea about how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spree emails are all text, and ofn's are html. So I think it's fine, from now on these will also be sent in html. Testing will validate that as well.
I think you are referring to something we could do which is to send html and text emails and the email client would use text as a fall back option. This is also good for deliverability but it's something we are not doing and is out of scope for this PR. Does this make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, I thought those text ones were just a fallback and not Spree's only templates 👍 Then, this means that those only-text emails saw Eugeni some time ago were a bug or they were missing an OFN template 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The emails seen by Eugeni are this shipment email. It was text in spree and after this PR it's html in OFN. But still without the normal OFN styling. That will need to be addressed in another PR.
OMG I'm just discovering this PR!!! Being able to translate this email is such a GOOOD news!! Thanks @luisramos0 !! |
I know!! :-) |
Hi @luisramos0, Triggered the following emails, before and after the PR: Test
Before After
Before After
These seem to be broken after this PR. I checked this both by clicking "Resend" or "Resend Confirmation" in the backoffice, and in both in this case, the user sees: After placing a new order, neither the Hub nor the customer receive confirmation email. This is a silent error, no snail seen. Check Bugsnag errors for details: https://app.bugsnag.com/yaycode/openfoodnetwork-uk/errors/5f228433c37fb80018f09297
The changes introduced by the PR work fine, but order confirmation/cancellation emails are quite a critical, so perhaps best not to introduce these in the code, right? I'm moving the PR back to In Dev for a second look. Some Updates:
Also, a product question maybe @RachL @lin-d-hop : I'm not sure what's the difference between the two buttons (pic below). "Resend Confirmation" triggers the modal asking for confirmation but other than that, is there a difference in function? |
Yes I've always wondered as well. 🤷 |
In that case, maybe we could consider removing one of them, maybe as a papercut - if appropriate. The "Resend Confirmation" button has a more descriptive naming and already has the associated modal, which is also helpful I think, so we could keep this one. Thoughts? |
Sounds good 👍 Let's re-test maybe just to see if it is really 100% the same? Maybe you already did? |
Yes, I found no difference - the emails looked identical, but I'd wait for feedback from core Devs as well. Perhaps @luisramos0 and/or reviewers can confirm that the code behind these features is the same? |
yes, the code is the same behind both resends 👍 Thanks for testing Filipe, I cant replicate that error locally. It's a tricky one related to class loading I think because the "missing method" is there and included as part of one of the helper classes... it should work. I'll have to come back to this later. |
Thanks for your feedback @luisramos0. The snail-errors were reproducible in staging environments (UK and FR). But thinking of it now, I am not entirely sure the PR broke the order confirmation emails as well, or they just got queued after the snail errors. Maybe testing in a different order would result in a different outcome. I'll try this and provide some additional feedback. Thanks as well for confirming the code on the "Resend" button 👍 |
I did a quick double-checked now: |
…he required ::CheckoutHelper in OFN The OFN checkoutHelper was not being included and instead the Spree::CheckoutHelper, that doesnt have the necessary helpers, was used
ok, this was easier than I thought. Yes, there was a bug in the code. There's Spree::CheckoutHelper in Spree that was hidden our CheckoutHelper. I managed to replicate the problem you describe, I pushed a new simple commit (no need for code review) and I restaged the PR. The problem is now gone. This is ready for testing again 👍 |
…xt and is now html This template needs to be revisited, this is just a quick fix
In staging I got the shipment email like this: So I added some paragraphs and breaklines to the template so it doesnt happen again. |
I've re-tested them all:
As all email works perfectly, I'm moving this to ready to go! |
What? Why?
Closes #5686
and addresses point 2 in openfoodfoundation/wishlist#357
Move all needed mailers from spree_core to OFN.
This was we can now translate test email and order shipped email (this email still needs a better template, but that will be for next time).
What should we test?
Here we change the base_mailer so better verify email basics like order confirmation and order cancellation for example. Are they sent correctly? Is the data in the email correct? Is the invoice email sent correctly?
Test the emails that were changed:
Release notes
Changelog Category: Changed
Brought test and shipment emails from Spree. Order Shipped email is now translatable!