A fully functional newsletter website, where you can subscribe and receive a welcoming email, and then receive periodically the newsletter. It also allows unsubscribing through a dedicated page.
newsletter-full.mp4
- CSS : all UI design is from me, container queries, variable font, grid, flexbox...
- HTML : form best practice and validation, semantic...
- Javascript : async/await, fetch API
- NodeJS
- Express
- SQLite database and SQL queries
- how to use Express
- create and manage SQL database
- handle HTTP requests and responses
- work asynchronously and handle errors in Node.JS
- setup backend routes and controllers
- HTML emails (different support rules of the mail clients, specific CSS rules applying to it...)
- create templating for content
- organize a front-in-back architecture
- deploy a front-in-back on an online server
- Subscription logic : Users can subscribe on homepage by filling and sending the form : lastName, firstName and email are added to SQLite Database. A notif confirms or infirms the subscription. An email confirms subscription and welcome new user.
- Unsubscription logic : Users can unsubscribe on the /unsubscribe page. It updates the database accordingly by removing. Checks if email is already in the DB, if not sends an error notif to user
- Newsletter Templates :
- Each newsletter is created within a template using handlebars
- Composing Newsletters :
- Each newsletter dynamically retrieve lastName and firstName to personalize the mail
- Sending newsletter :
- Middleware retrieve subscribers' information from the SQL DB
- Sendgrid npm package is used to send newsletters to the subscribers.
- Allowing the client to render the email in browser :
- implemented a route that takes a query parameter to decide to render the "welcomeEmail" or the "newsletter" in a new tab.
- Scheduling Newsletter Sending:
- Nodecron can send newsletters every Saturday. Not activating the function to not pollute email boxes of people trying the deployed version.
- Deploy on fly.io