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

Newsletter #70

Closed
SantosGuillamot opened this issue Apr 1, 2020 · 7 comments · Fixed by #75
Closed

Newsletter #70

SantosGuillamot opened this issue Apr 1, 2020 · 7 comments · Fixed by #75
Assignees
Labels

Comments

@SantosGuillamot
Copy link
Member

SantosGuillamot commented Apr 1, 2020

Description

We're going to have a reusable block named "Newsletter" that could be placed anywhere in the web. Right now, it's only used in the footer, so we should add it there.

In order to implement this, we are going to reuse the logic of our current newsletter form. Bear in mind:

  • The design is different.
  • We are not including the role field.
  • We have to add the logic for the afterNewsletter as well.

Logic

  • In order to connect the newsletter form with services like Vero, Amplitude or Analytics, we are using Google Tag Manager to manage all of them, so we have to make sure to send the proper information there (this is already done in the repo of the current newsletter).

  • There will be four different status of the form:

Normal
The status before the user starts interacting with it.
Screenshot from 2020-04-01 10-37-31

Active
Once the user clicks on the input field, the border color should change and use state.theme.colors.frontity.

Wrong
When the user try to submit something that is not an email, or they haven't check the Privacy Policy, we should standard error like the current frontity.org. Something like this:
Screenshot from 2020-04-01 10-38-14

Success
When the email has been submitted correctly, we should change the form for a "Thanks message". Something similar to what next.js is doing.

Before submitting:
Screenshot from 2020-04-01 10-44-46

After submitting:
Screenshot from 2020-04-01 10-45-10

Possible solution

  • For linking the form with Google Tag Manager, we should reuse the logic of the current newsletter.
  • We'll need to process the className newsletter and create a new React component with the content found there. This processor would work different than the other ones, as we don't have to keep the content structure. We could use each different element of it to populate the component.

HTML

Our first idea about the Gutenberg HTML of the newsletter group is the following:

  • The inner blocks for grouping editable content:
//Name of the editable content
<h6>Placeholder email</h6>

//HTML of the editable content
<p>Enter your email</p>

We could create a grouping div for them if you feel it would be easier. We are using <h6> to specify in the Gutenberg editor which content are we changing in each paragraph, but it should be deleted in the React component. Apart from that, <h6> isn't used in the rest of the web and this way it's clearer that is just for editable content.

  • The whole newsletter Gutenberg HTML would be something like this:
<div class="wp-block-group newsletter">
  <div class="wp-block-group__inner-container">
    <h4>Join the Frontity newsletter</h4>
    <p>Stay up-to-date on new releases and features, tutorials, and community news.</p>
    
    <h6>Placeholder email</h6>
    <p>Enter your email</p>

    <h6>Privacy Policy checkbox</h6>
    <p>I agree to the <a href="https://frontity.org/privacy-policy">Privacy Policy</a></p> 
    
    <h6>Thank you message</h6>
    <p>Thank you! You have been subscribed to the Frontity newsletter. You will receive a welcome email shortly.</p>

  </div>
</div>

As said, we should consider if grouping the editable content would be easier.

Where to check

@SantosGuillamot SantosGuillamot created this issue from a note in Sprint 1 (closed) (To do) Apr 1, 2020
@SantosGuillamot SantosGuillamot moved this from To do to In progress in Sprint 1 (closed) Apr 1, 2020
@SantosGuillamot SantosGuillamot moved this from In progress to Blocked in Sprint 1 (closed) Apr 1, 2020
@SantosGuillamot
Copy link
Member Author

I'm blocking it until we have the design of the checkbox.

@luisherranz
Copy link
Member

Thanks Mario. Could you please specify the Gutenberg inner blocks that will be used for the editable content?

@SantosGuillamot
Copy link
Member Author

Oh yes, I forgot to post that sorry. I've updated the opening post.

@SantosGuillamot
Copy link
Member Author

The designer has updated this, so I'm unblocking the issue.

@SantosGuillamot SantosGuillamot moved this from Blocked to To do in Sprint 1 (closed) Apr 1, 2020
@luisherranz
Copy link
Member

Thanks Mario.

Some feedback about the editable content:

  • I don't think placeholders are necessary, they are not going to change.
  • I don't think the Privacy Policy is necessary, it is not going to change.
  • The title, description and thank-you message are fine, but it's going to be hard to retrieve from the HTML with that layout. It's easier if that information is in the node itself. For example:
    • Using classes:
      <p class="title">Join the Frontity newsletter</p>
      <p class="description">Stay up-to-date on new releases and features, tutorials, and community news.</p>
      <p class="thank-you">Thank you! You have been subscribed to the Frontity newsletter. You will receive a welcome email shortly.</p>
    • Using children order (1st title, 2nd desc, 3rd thank-you):
      <p>Join the Frontity newsletter</p>
      <p>Stay up-to-date on new releases and features, tutorials, and community news.</p>
      <p>Thank you! You have been subscribed to the Frontity newsletter. You will receive a welcome email shortly.</p>

@SantosGuillamot
Copy link
Member Author

Yes, I agree that the placeholders and the Privacy Policy shouldn't change. Regarding the layout, I'd prefer using classes, it looks clearer to me.

@SantosGuillamot SantosGuillamot linked a pull request Apr 6, 2020 that will close this issue
2 tasks
@SantosGuillamot
Copy link
Member Author

In order to test if the logic of the old implementation could work, and check the best way to connect Gutenberg and React, I created this draft Pull Request #75 . It works so I guess the migration is possible. I share it in case it's useful as an starting point.

@michalczaplinski michalczaplinski self-assigned this Apr 13, 2020
@michalczaplinski michalczaplinski moved this from To do to In progress in Sprint 1 (closed) Apr 13, 2020
@michalczaplinski michalczaplinski moved this from In progress to Blocked in Sprint 1 (closed) Apr 14, 2020
Sprint 1 (closed) automation moved this from Blocked to Done Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants