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

White Label: remove OFN banner from order confirmation emails when hide_ofn_navigation is activated for the shop #10744

Conversation

jibees
Copy link
Contributor

@jibees jibees commented Apr 25, 2023

⚠️ I did not put this feature behind the feature toggle white_label as we want it to be soon removed. That's why this PR should not be merge until we completely remove the white_label feature toggle.

But this is ready to be reviewed.

What? Why?

BEFORE

Capture d’écran 2023-04-25 à 10 31 18

AFTER

Capture d’écran 2023-04-25 à 10 31 29

What should we test?

  • As a super-admin, activate white_label feature toggle for the instance
  • As a super-admin, activate hide_ofn_navigation for the shop in /admin/enterprises/ENTERPRISE_SLUG/edit#/white_label_panel

Capture d’écran 2023-04-25 à 10 37 08

  • Check that order confirmation email does not contains the OFN header.

Release notes

Changelog Category: User facing changes

@jibees jibees self-assigned this Apr 25, 2023
@jibees
Copy link
Contributor Author

jibees commented Apr 25, 2023

@kirstenalarsen I added screenshots before/after. Just one feedback if it looks right ;) Thanks! 🙏

@jibees jibees force-pushed the 10556-remove-ofn-header-banner-in-order-confirmation-emails branch 2 times, most recently from b9c4d7a to 49ae06e Compare April 25, 2023 09:38
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, a nice simple addition built on top of the previous work.

Comment on lines +3 to +7
class SubscriptionMailerPreview < ActionMailer::Preview
def confirmation_email
SubscriptionMailer.confirmation_email(Spree::Order.complete.last)
end
end
Copy link
Member

Choose a reason for hiding this comment

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

💯

@dacook dacook added the blocked label Apr 26, 2023
@dacook
Copy link
Member

dacook commented Apr 26, 2023

Putting back to 'in dev' because it doesn't need further review, but will need a rebase before it can be tested.

@jibees jibees force-pushed the 10556-remove-ofn-header-banner-in-order-confirmation-emails branch from 49ae06e to 47e2a0d Compare April 26, 2023 13:58
@jibees jibees force-pushed the 10556-remove-ofn-header-banner-in-order-confirmation-emails branch 2 times, most recently from 18683de to 106a778 Compare May 15, 2023 15:46
@drummer83
Copy link
Contributor

Does the email footer need adjustment as well?
Ping @kirstenalarsen

@drummer83
Copy link
Contributor

Unblocked, since #10824 was closed with #10825.

@drummer83 drummer83 removed the blocked label May 16, 2023
@jibees jibees force-pushed the 10556-remove-ofn-header-banner-in-order-confirmation-emails branch from 106a778 to 3f044a8 Compare May 16, 2023 12:48
@jibees jibees marked this pull request as ready for review May 16, 2023 13:35
@drummer83 drummer83 self-assigned this May 16, 2023
@drummer83 drummer83 added pr-staged-au staging.openfoodnetwork.org.au pr-staged-uk staging.openfoodnetwork.org.uk labels May 16, 2023
@drummer83
Copy link
Contributor

Hi @jibees,
Sorry, I don't know why but I still see the OFN header in the confirmation email.

This is the order confirmation email of a white labelled enterprise next to the order confirmation screen of the same order:
image

And this is the same for an order at a not-white-labelled enterprise:
image

For easier comparison you can see that both emails are identical in term of the banner:
image

I have tried this on staging UK and AU to exclude some mistake of mine. Both the same.
I'll move it back to In Dev. Let me know if I missed anything.

Thanks!

@drummer83 drummer83 removed their assignment May 16, 2023
@drummer83 drummer83 removed pr-staged-uk staging.openfoodnetwork.org.uk pr-staged-au staging.openfoodnetwork.org.au labels May 16, 2023
@jibees jibees added the pr-staged-uk staging.openfoodnetwork.org.uk label May 17, 2023
@jibees
Copy link
Contributor Author

jibees commented May 17, 2023

I (re)tested locally and works fine for me. Looks like something happens...

I redeployed the PR on staging-uk, and wanted to test the latest confirmation email sent on the browser via URL: https://staging.openfoodnetwork.org.uk/rails/mailers/subscription_mailer/confirmation_email (this URL to test confirmation email was introduced by this PR). I got a 404. So I suppose the PR hasn't been deployed on staging.

Will investigate...

@jibees jibees force-pushed the 10556-remove-ofn-header-banner-in-order-confirmation-emails branch from 3f044a8 to cdec3ab Compare May 17, 2023 08:16
@jibees
Copy link
Contributor Author

jibees commented May 17, 2023

I force pushed and give another try via semaphore. I tested URL, and 404 too.

Then, I decided to deploy through ansible script via ansible-playbook playbooks/deploy.yml --extra-vars "github_key=jibees:10556-remove-ofn-header-banner-in-order-confirmation-emails" --limit=uk-staging

PLAY RECAP **************************************************************************************************************************************************************************************
staging.openfoodnetwork.org.uk : ok=33   changed=20   unreachable=0    failed=0    skipped=6    rescued=0    ignored=0

But same conclusion, URL is not accessible.

@jibees
Copy link
Contributor Author

jibees commented May 17, 2023

oops, mailer previews aren't not available on staging for sure... 🤦

@jibees jibees force-pushed the 10556-remove-ofn-header-banner-in-order-confirmation-emails branch from 5d8c33f to cdec3ab Compare May 17, 2023 08:49
@jibees
Copy link
Contributor Author

jibees commented May 17, 2023

Thanks a lot @drummer83. I did not use the right mail... I used the subscription email "This order was automatically placed for you, and it has now been finalised. ...."

Should we also remove OFN banner on that one too @kirstenalarsen ?

jibees added 4 commits May 17, 2023 11:34
…d order

Available on: `/rails/mailers/subscription_mailer/confirmation_email`
… label

+ add specs that test for the presence of the footer logo which is in the header (I know it's a bit contradictory)
Available on `/rails/mailers/order_mailer/confirm_email_for_customer`
@jibees jibees force-pushed the 10556-remove-ofn-header-banner-in-order-confirmation-emails branch from 1522bac to 2336981 Compare May 17, 2023 09:35
@jibees jibees added feedback-needed and removed pr-staged-uk staging.openfoodnetwork.org.uk labels May 17, 2023
@kirstenalarsen
Copy link
Contributor

yes please @jibees !

@jibees
Copy link
Contributor Author

jibees commented May 22, 2023

Back in code review then

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!

@drummer83 drummer83 self-assigned this May 23, 2023
@drummer83 drummer83 added the pr-staged-uk staging.openfoodnetwork.org.uk label May 23, 2023
@drummer83
Copy link
Contributor

Hi @jibees,
Thank you for this next part of white-labelling!

I compared some emails of a regular shopfront with a white-labelled one.

Left: regular shopfront; Right: white-labelled shopfront;
Order confirmation emails for customers (regular orders) is white-labelled. ✔️
image

Subscriptions: Order created email is not white-labelled. ❌
image

Subscriptions: Order confirmed email is white-labelled. ✔️
image

Other email, like the order confirmation emails for enterprise owners and sign up emails are not affected and still not white-labelled. ✔️
image
image

I think we can merge this one as it is a big step forward without any regressions. Probably the 'order placed' email needs to be white-labelled as well!? @kirstenalarsen
I didn't think of it either.

@drummer83 drummer83 removed the pr-staged-uk staging.openfoodnetwork.org.uk label May 23, 2023
@drummer83 drummer83 merged commit 0854287 into openfoodfoundation:master May 23, 2023
@kirstenalarsen
Copy link
Contributor

kirstenalarsen commented May 24, 2023 via email

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

Successfully merging this pull request may close these issues.

Remove OFN header / banner in order confirmation emails
5 participants