1 00:00:00,480 --> 00:00:02,530 We are now in a really good spot with billing. 2 00:00:02,550 --> 00:00:07,680 We're in a good spot with authentication and we are in a really good spot with the entire deployment 3 00:00:07,680 --> 00:00:09,080 process as well. 4 00:00:09,090 --> 00:00:13,290 So from here on out throughout the rest of the course we're really just going to be focused on building 5 00:00:13,290 --> 00:00:17,610 out some remaining features around the survey aspects of our application. 6 00:00:17,610 --> 00:00:23,100 Now I know that we've spent a lot of time in this course getting just this far but remember that all 7 00:00:23,100 --> 00:00:27,810 the functionality was put together so far has been really a pretty good amount of stuff to write up 8 00:00:27,810 --> 00:00:28,360 by hand. 9 00:00:28,380 --> 00:00:34,260 Like if you're just focused on getting the code down on the screen to also add in and say well we also 10 00:00:34,260 --> 00:00:39,240 want to walk through this stuff carefully and have in-depth detailed discussions about what's going 11 00:00:39,240 --> 00:00:39,900 on. 12 00:00:39,900 --> 00:00:42,040 Inevitably it ends up taking a lot of time. 13 00:00:42,060 --> 00:00:47,670 So I know that this is a long course but we are covering a lot of different ground. 14 00:00:47,850 --> 00:00:51,960 So in this section I want to start thinking about the next feature that we're going to be building on 15 00:00:52,380 --> 00:00:56,440 which is going to be the survey endpoint on our API. 16 00:00:56,640 --> 00:01:03,020 So in other words the ability for users to create surveys to send them out and to somehow record feedback. 17 00:01:03,330 --> 00:01:09,120 So before we dive in headfirst into start writing code it's really important that we have a very solid 18 00:01:09,120 --> 00:01:13,060 idea of exactly how these surveys are going to be working. 19 00:01:13,080 --> 00:01:18,050 So let's check out a couple of diagrams to get a much better picture of what's going on here. 20 00:01:19,290 --> 00:01:19,610 OK. 21 00:01:19,610 --> 00:01:24,590 So this is our flow of exactly what's going to happen when the user creates a survey. 22 00:01:24,830 --> 00:01:31,630 So remember the entire point of this application is we have in theory startup owners or product owners. 23 00:01:31,640 --> 00:01:36,680 They want to solicit feedback from their end users the people who are using their products and they're 24 00:01:36,680 --> 00:01:38,430 using our service to do so. 25 00:01:38,510 --> 00:01:39,680 They ought to do a survey. 26 00:01:39,680 --> 00:01:43,730 They send it out to a list of all their people and that's pretty much it. 27 00:01:43,730 --> 00:01:46,040 So let's walk through this flow. 28 00:01:46,040 --> 00:01:52,540 We start off at the top left where a user creates a survey with a simple yes or no question. 29 00:01:52,580 --> 00:01:57,110 So just to be really clear when we talked about Survey and the type of feedback that people are going 30 00:01:57,110 --> 00:02:03,460 to solicit here we are just trying to solicit yes or no responses to a very simple question. 31 00:02:03,470 --> 00:02:05,320 Now you might be thinking in your head. 32 00:02:05,340 --> 00:02:11,270 Well Stephen I want to do a fancy survey form where people can have like radio buttons and check boxes 33 00:02:11,270 --> 00:02:15,650 and all these other types of inputs that the user can enter feedback into. 34 00:02:15,890 --> 00:02:17,300 And you know that's fine. 35 00:02:17,300 --> 00:02:22,420 The application we're building can certainly be expanded to accommodate for that type of feedback. 36 00:02:22,550 --> 00:02:28,130 But what we're doing is really just focused on some of the high level get the form together send it 37 00:02:28,130 --> 00:02:30,340 out to users collect feedback via email. 38 00:02:30,500 --> 00:02:35,540 If we started to go really deep into customizing the feedback stuff well we would be talking about an 39 00:02:35,540 --> 00:02:38,450 additional like 10 hours of content just to do that stuff. 40 00:02:38,450 --> 00:02:41,360 So again it's kind of all about time here. 41 00:02:41,360 --> 00:02:42,280 All right. 42 00:02:42,650 --> 00:02:50,100 So users going to create the survey which is going to essentially ask a very simple yes or no question. 43 00:02:50,100 --> 00:02:55,730 They're then going to send that survey form or kind of the intent to create a survey and email it out 44 00:02:55,730 --> 00:03:02,180 to a list of people to our back and API are back in the API is then going to take all that information 45 00:03:02,480 --> 00:03:04,130 that should be placed into a survey. 46 00:03:04,130 --> 00:03:07,990 So this might be like the title of the survey that people just send it to. 47 00:03:08,000 --> 00:03:12,490 And the question to ask and it's going to create an e-mail template out of it. 48 00:03:12,530 --> 00:03:17,600 So that process is going to occur on our express Server Express server. 49 00:03:17,770 --> 00:03:24,640 We'll then use a third party e-mail provider to send out a big giant blast e-mail to all the people 50 00:03:24,760 --> 00:03:26,960 who are supposed to be getting this survey. 51 00:03:27,010 --> 00:03:31,540 So it might be five people it might be 10 it might be a thousand different people who are supposed to 52 00:03:31,540 --> 00:03:32,820 receive this survey. 53 00:03:34,110 --> 00:03:39,840 Once all these people these end users so to speak receive the survey inside their e-mail box they will 54 00:03:39,840 --> 00:03:45,000 then click yes or no to answer the question presented in a given survey. 55 00:03:45,000 --> 00:03:50,130 Now here's the interesting part right here and we will dive a lot into exactly why this is going to 56 00:03:50,130 --> 00:03:51,100 work the way it is. 57 00:03:51,260 --> 00:03:55,200 But it's going to first tell you exactly how it's going to work and it will come back later and talk 58 00:03:55,200 --> 00:03:58,540 a little bit about why we're taking this particular approach later on. 59 00:03:58,890 --> 00:04:05,220 So when we send out that e-mail to you all these different users the user will then click yes or no 60 00:04:05,610 --> 00:04:10,590 on the e-mail and we'll have like a little link it'll say do you enjoy your service with our company 61 00:04:10,590 --> 00:04:14,420 or whatever it might be you know click yes I enjoyed it or no I did not. 62 00:04:14,430 --> 00:04:21,000 Now when they clicked that link our e-mail provider like the third party company who is facilitating 63 00:04:21,000 --> 00:04:28,260 the e-mail process like sending out the e-mails is going to be the one who notes whether or not the 64 00:04:28,260 --> 00:04:30,150 user clicked yes or no. 65 00:04:30,840 --> 00:04:35,400 And again I'll tell you why that is later on we start to actually implement or maybe even this video 66 00:04:35,400 --> 00:04:36,610 or the next one we'll see. 67 00:04:36,930 --> 00:04:43,530 So the e-mail provider will note the users response the e-mail provider will then send a note to our 68 00:04:43,530 --> 00:04:48,870 express server saying hey someone just clicked the link and they said yes on this particular survey 69 00:04:48,870 --> 00:04:50,280 they enjoyed their experience. 70 00:04:50,290 --> 00:04:52,600 They're giving you positive feedback or whatever. 71 00:04:52,710 --> 00:04:57,450 And then our express server will be responsible for recording that little bit of feedback inside of 72 00:04:57,450 --> 00:04:59,040 our Mongo database. 73 00:04:59,040 --> 00:05:01,130 So again this is the overall flow. 74 00:05:01,290 --> 00:05:06,000 The two big things to keep in mind here are that the actual survey that is being sent out will be a 75 00:05:06,000 --> 00:05:08,490 very simple yes or no type question. 76 00:05:08,700 --> 00:05:13,560 And then the other big kind of twist here to keep in mind is that whenever a user clicks on a link like 77 00:05:13,590 --> 00:05:19,950 yes or no to respond to the survey in their e-mail they're going to be sending some type of information 78 00:05:19,950 --> 00:05:25,180 packet or they're essentially notifying our e-mail provider that they clicked yes or no. 79 00:05:25,350 --> 00:05:31,080 And then again the e-mail provider will communicate back to our express API to say hey this person just 80 00:05:31,080 --> 00:05:34,330 clicked on this link and they said yes they like it or no they don't. 81 00:05:34,840 --> 00:05:35,330 OK. 82 00:05:35,520 --> 00:05:36,720 So it this flow in mind. 83 00:05:36,720 --> 00:05:40,640 Let's take a look at what a sample e-mail might look like. 84 00:05:40,650 --> 00:05:44,030 So this is give me a sample e-mail that someone might receive in their inbox. 85 00:05:44,070 --> 00:05:47,490 So as you can see I'm saying yeah maybe we're looking at gmail here. 86 00:05:47,910 --> 00:05:49,890 So it's going to have some type of subject. 87 00:05:49,970 --> 00:05:57,210 It's going to have a from field and then the e-mail will have some text or body of the survey itself. 88 00:05:57,270 --> 00:06:00,950 And then again a very simple yes or no response. 89 00:06:00,960 --> 00:06:02,540 So again like I said before. 90 00:06:02,850 --> 00:06:03,710 Absolutely. 91 00:06:03,750 --> 00:06:06,980 This entire e-mail could be further customized if we want to. 92 00:06:07,050 --> 00:06:12,180 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 93 00:06:12,180 --> 00:06:15,630 of leave the process of enhancing how it behaves to you. 94 00:06:17,160 --> 00:06:21,470 Now looking at the e-mail there's some very particular things I want to point out in here. 95 00:06:21,480 --> 00:06:26,910 First off you'll notice that we are going to allow our users like our users the people creating the 96 00:06:26,910 --> 00:06:30,680 survey to customize the subject of the e-mail. 97 00:06:30,840 --> 00:06:34,350 So the email subject should be able to be customized. 98 00:06:34,620 --> 00:06:36,640 Next the From field. 99 00:06:36,660 --> 00:06:39,650 Inside that e-mail should be able to be customized as well. 100 00:06:39,840 --> 00:06:45,600 So our users should be able to say hey if anyone replies to this email make sure that the reply gets 101 00:06:45,600 --> 00:06:50,380 sent to like our customer service address as opposed to our company. 102 00:06:50,400 --> 00:06:56,760 You and me the developers of the email address of like support at email dot com. 103 00:06:56,760 --> 00:06:58,860 You and I don't want to get feedback from these users. 104 00:06:58,860 --> 00:07:02,200 You and I don't want people to hit reply and send something back to you and me. 105 00:07:02,310 --> 00:07:07,410 So we want to make sure that whoever is creating creating these surveys is the one who is receiving 106 00:07:07,410 --> 00:07:11,930 any response emails that a user might be sending back. 107 00:07:12,010 --> 00:07:16,300 Not a lot of part that can be customized will be the actual body of the email. 108 00:07:16,560 --> 00:07:21,620 So this note right here should be able to or user shipbuilder customize it to a degree to be able to 109 00:07:21,810 --> 00:07:24,960 type in a custom mode and explain what's going on here. 110 00:07:25,200 --> 00:07:30,160 As far as the actual feedback mechanism again it's a simple yes or no question. 111 00:07:30,240 --> 00:07:31,730 No further customization. 112 00:07:31,770 --> 00:07:36,040 Outside of that right now just yes you enjoyed our service or no you did not. 113 00:07:36,240 --> 00:07:40,880 And that's the sole thing that we're going to be collecting and presenting back to our users. 114 00:07:41,400 --> 00:07:43,360 OK so that's the general idea. 115 00:07:43,360 --> 00:07:46,030 It's kind of in general what we're trying to accomplish here. 116 00:07:46,080 --> 00:07:49,810 So now we've got a better sense of exactly what we're building on the survey side. 117 00:07:49,830 --> 00:07:50,810 Let's take a quick break. 118 00:07:50,850 --> 00:07:55,260 We're going to come back in the next section and talk about some considerations around building the 119 00:07:55,260 --> 00:07:58,120 actual server survey stuff on our server. 120 00:07:58,380 --> 00:08:00,040 So I'll see you in just a minute.