We are now in a really good spot with billing.
We're in a good spot with authentication and we are in a really good spot with the entire deployment
process as well.
So from here on out throughout the rest of the course we're really just going to be focused on building
out some remaining features around the survey aspects of our application.
Now I know that we've spent a lot of time in this course getting just this far but remember that all
the functionality was put together so far has been really a pretty good amount of stuff to write up
by hand.
Like if you're just focused on getting the code down on the screen to also add in and say well we also
want to walk through this stuff carefully and have in-depth detailed discussions about what's going
on.
Inevitably it ends up taking a lot of time.
So I know that this is a long course but we are covering a lot of different ground.
So in this section I want to start thinking about the next feature that we're going to be building on
which is going to be the survey endpoint on our API.
So in other words the ability for users to create surveys to send them out and to somehow record feedback.
So before we dive in headfirst into start writing code it's really important that we have a very solid
idea of exactly how these surveys are going to be working.
So let's check out a couple of diagrams to get a much better picture of what's going on here.
OK.
So this is our flow of exactly what's going to happen when the user creates a survey.
So remember the entire point of this application is we have in theory startup owners or product owners.
They want to solicit feedback from their end users the people who are using their products and they're
using our service to do so.
They ought to do a survey.
They send it out to a list of all their people and that's pretty much it.
So let's walk through this flow.
We start off at the top left where a user creates a survey with a simple yes or no question.
So just to be really clear when we talked about Survey and the type of feedback that people are going
to solicit here we are just trying to solicit yes or no responses to a very simple question.
Now you might be thinking in your head.
Well Stephen I want to do a fancy survey form where people can have like radio buttons and check boxes
and all these other types of inputs that the user can enter feedback into.
And you know that's fine.
The application we're building can certainly be expanded to accommodate for that type of feedback.
But what we're doing is really just focused on some of the high level get the form together send it
out to users collect feedback via email.
If we started to go really deep into customizing the feedback stuff well we would be talking about an
additional like 10 hours of content just to do that stuff.
So again it's kind of all about time here.
All right.
So users going to create the survey which is going to essentially ask a very simple yes or no question.
They're then going to send that survey form or kind of the intent to create a survey and email it out
to a list of people to our back and API are back in the API is then going to take all that information
that should be placed into a survey.
So this might be like the title of the survey that people just send it to.
And the question to ask and it's going to create an e-mail template out of it.
So that process is going to occur on our express Server Express server.
We'll then use a third party e-mail provider to send out a big giant blast e-mail to all the people
who are supposed to be getting this survey.
So it might be five people it might be 10 it might be a thousand different people who are supposed to
receive this survey.
Once all these people these end users so to speak receive the survey inside their e-mail box they will
then click yes or no to answer the question presented in a given survey.
Now here's the interesting part right here and we will dive a lot into exactly why this is going to
work the way it is.
But it's going to first tell you exactly how it's going to work and it will come back later and talk
a little bit about why we're taking this particular approach later on.
So when we send out that e-mail to you all these different users the user will then click yes or no
on the e-mail and we'll have like a little link it'll say do you enjoy your service with our company
or whatever it might be you know click yes I enjoyed it or no I did not.
Now when they clicked that link our e-mail provider like the third party company who is facilitating
the e-mail process like sending out the e-mails is going to be the one who notes whether or not the
user clicked yes or no.
And again I'll tell you why that is later on we start to actually implement or maybe even this video
or the next one we'll see.
So the e-mail provider will note the users response the e-mail provider will then send a note to our
express server saying hey someone just clicked the link and they said yes on this particular survey
they enjoyed their experience.
They're giving you positive feedback or whatever.
And then our express server will be responsible for recording that little bit of feedback inside of
our Mongo database.
So again this is the overall flow.
The two big things to keep in mind here are that the actual survey that is being sent out will be a
very simple yes or no type question.
And then the other big kind of twist here to keep in mind is that whenever a user clicks on a link like
yes or no to respond to the survey in their e-mail they're going to be sending some type of information
packet or they're essentially notifying our e-mail provider that they clicked yes or no.
And then again the e-mail provider will communicate back to our express API to say hey this person just
clicked on this link and they said yes they like it or no they don't.
OK.
So it this flow in mind.
Let's take a look at what a sample e-mail might look like.
So this is give me a sample e-mail that someone might receive in their inbox.
So as you can see I'm saying yeah maybe we're looking at gmail here.
So it's going to have some type of subject.
It's going to have a from field and then the e-mail will have some text or body of the survey itself.
And then again a very simple yes or no response.
So again like I said before.
Absolutely.
This entire e-mail could be further customized if we want to.
But in the context of course it's kind of all about time and I want to show you how to do this and kind
of leave the process of enhancing how it behaves to you.
Now looking at the e-mail there's some very particular things I want to point out in here.
First off you'll notice that we are going to allow our users like our users the people creating the
survey to customize the subject of the e-mail.
So the email subject should be able to be customized.
Next the From field.
Inside that e-mail should be able to be customized as well.
So our users should be able to say hey if anyone replies to this email make sure that the reply gets
sent to like our customer service address as opposed to our company.
You and me the developers of the email address of like support at email dot com.
You and I don't want to get feedback from these users.
You and I don't want people to hit reply and send something back to you and me.
So we want to make sure that whoever is creating creating these surveys is the one who is receiving
any response emails that a user might be sending back.
Not a lot of part that can be customized will be the actual body of the email.
So this note right here should be able to or user shipbuilder customize it to a degree to be able to
type in a custom mode and explain what's going on here.
As far as the actual feedback mechanism again it's a simple yes or no question.
No further customization.
Outside of that right now just yes you enjoyed our service or no you did not.
And that's the sole thing that we're going to be collecting and presenting back to our users.
OK so that's the general idea.
It's kind of in general what we're trying to accomplish here.
So now we've got a better sense of exactly what we're building on the survey side.
Let's take a quick break.
We're going to come back in the next section and talk about some considerations around building the
actual server survey stuff on our server.
So I'll see you in just a minute.