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 Autoresponder to Stripe #1675

Merged
merged 15 commits into from
Jul 10, 2023
Merged

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented May 26, 2023

Closes #1611.

Summary

Add Autoresponder functions to Stripe Checkout

Workflow:

  1. Client successfully buys the products in the Stripe interface, then it is redirected to the product's page.
  2. We check if we have sent an email before via transition.
  3. If not, we take the email provided by Stripe and then make an email with the given subject and message by the user. Then we mark this as sent in a transition.

Screenshots

🟢 Pro not installed and license inactive -- Upsell

image

🟢 Pro installed and license inactive.

image

🟢 Pro installed and license active.

image

🟢 Default email message.

image


Test instructions

ℹ️ You will need a Stripe developer account & STMP connection (you can try WP SMTP plugin and GMAIL API)
ℹ️ You will put values for the subject and body. The values that you see as default are placeholders.
⚠️ The placeholder for the body massage is not a traditional placeholder. If you change the message, it will be considered a value -- this is a limitation of the component.

  • Check if the autoresponder is working as expected.
  • Make sure the email is sent only once.
  • Only Pro users can use it.
  • Free users see the Upsell.
  • People with expired licenses will see a small notice about the invalid licenses.

Checklist before the final review

  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this May 26, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel linked an issue May 26, 2023 that may be closed by this pull request
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review May 29, 2023 11:56
@pirate-bot
Copy link
Contributor

pirate-bot commented May 29, 2023

Bundle Size Diff

Package Old Size New Size Diff
Animations 192.38 KB 192.38 KB 0 B (0.00%)
Blocks 1.34 MB 1.34 MB 1.75 KB (0.13%)
CSS 6.9 KB 6.9 KB 0 B (0.00%)
Dashboard 44.32 KB 44.32 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 223.84 KB 225.44 KB 1.59 KB (0.71%)

@pirate-bot
Copy link
Contributor

pirate-bot commented May 29, 2023

Plugin build for 97c87fe is ready 🛎️!

Copy link
Member

@HardeepAsrani HardeepAsrani left a comment

Choose a reason for hiding this comment

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

I've added some small changes and few NITs, but overall it looks good.

@pirate-bot
Copy link
Contributor

pirate-bot commented May 30, 2023

E2E Summary

Typing

Test Average Time (ms) Standard Deviation (ms) Median Time (ms) Quantile for soft limit (%) Quantile for hard limit (%)
Typing 48.23 4.99 48.59 94.74 (60ms) 100 (80ms)
Values above 60ms "10 - 61.14"

@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Jun 8, 2023
Copy link
Member

@HardeepAsrani HardeepAsrani left a comment

Choose a reason for hiding this comment

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

Few minor changes.

Copy link
Member

@HardeepAsrani HardeepAsrani left a comment

Choose a reason for hiding this comment

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

There's an issue when you open one RichText area first and then open the other one, as seen here: https://www.loom.com/share/bb3e51015b9d433b809756a875f8f719

These steps work in opposite too, if you open the Autoresponder first and then Messages popup.

@Soare-Robert-Daniel
Copy link
Contributor Author

There's an issue when you open one RichText area first and then open the other one, as seen here:

This was caused by the lack of a unique ID on the RichTextEditor component, thus the conflict on the same block since it reuse the component.

🔧 Added an area identifier property so we can properly separate the context.

@irinelenache
Copy link
Contributor

@Soare-Robert-Daniel Tested and found some small things, more like questions:

  • Shouldn't we show a notice/warning to the user if he uses the autoresponder feature and doesn't have the SMTP set?
  • Same when the user just wants to test the feature and sticks with the default Subject & Body messages. I think we should say that the email won't be sent if those values aren't changed

Regarding the functionality, everything works as expected 🚀

@AndreeaCristinaRadacina
Copy link

Hi there,

Do you think maybe it would be good to have a Save button after inserting a body text in the Autoresponder?
Right now, we have to just click in the "x" button to exit the popup:
image
The message is indeed kept, but there is usually a save button and this is why I asked.

@HardeepAsrani
Copy link
Member

@AndreeaCristinaRadacina I do like the idea but right now the text saves as you type, so having a Save button won't serve any purpose. Let me know what you think.

@AndreeaCristinaRadacina
Copy link

@HardeepAsrani, indeed, the popup works as expected. It was just a suggestion for more consistency, but it's not mandatory

@Soare-Robert-Daniel
Copy link
Contributor Author

@irinelenache @HardeepAsrani, I added a small notification for the user to replace the placeholders.

image

@HardeepAsrani
Copy link
Member

@Soare-Robert-Daniel The notice is a bit redundant, I can see from the Subject input that its placeholder and not value. I think it's fine without the notice.

@Soare-Robert-Daniel
Copy link
Contributor Author

Notice is now removed.

@irinelenache
Copy link
Contributor

@Soare-Robert-Daniel Had another look and everything's ok here 👍

@HardeepAsrani HardeepAsrani merged commit 92a5157 into development Jul 10, 2023
10 of 11 checks passed
@HardeepAsrani HardeepAsrani deleted the feat/stripe-autoresponder branch July 10, 2023 12:47
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 2.3.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoresponder for Stripe Block
5 participants