1
00:00:00,570 --> 00:00:08,370
Once we have set up Zehnder identity next, we want to create an API key and start sending emails using

2
00:00:08,370 --> 00:00:08,980
the same grid.

3
00:00:09,390 --> 00:00:14,490
So in the dashboard, look for email API and line the integration.

4
00:00:14,500 --> 00:00:18,990
Good, then you'll need to choose the Web API.

5
00:00:20,040 --> 00:00:26,640
After that, we're going to go with a. James and lastly here will create an API key.

6
00:00:26,910 --> 00:00:28,560
So you just need to come up with a name.

7
00:00:28,800 --> 00:00:35,870
In my case, I'm just going to go with my first API key and let's create the key.

8
00:00:36,420 --> 00:00:45,390
And once we have the key, we want to go to data and we grab the key copy and paste and set it up as

9
00:00:45,390 --> 00:00:46,740
the environment variable.

10
00:00:47,160 --> 00:00:53,570
And again, the name is really up to you, but I'm just going to go with this grid API key.

11
00:00:54,000 --> 00:00:55,340
So let's do that.

12
00:00:55,350 --> 00:01:02,480
We're going to navigate back to the star and create a new file DOT N.V. and we're going to go with Sand

13
00:01:02,490 --> 00:01:08,660
Grid, underscore API, underscore key, and now you just want to get that value.

14
00:01:09,000 --> 00:01:11,010
So I'm going to copy and paste the value.

15
00:01:11,280 --> 00:01:16,290
And once everything is in place, then we want to install the package.

16
00:01:16,560 --> 00:01:21,380
So take a look at the package JSON if you already see at standard email.

17
00:01:21,720 --> 00:01:25,500
So that's the library they created for us, then you're good to go.

18
00:01:25,500 --> 00:01:27,300
Then you can right away start a server.

19
00:01:27,570 --> 00:01:32,640
But if you don't see it in a package, JSON, which is going to be my case since I'm adding the videos

20
00:01:32,640 --> 00:01:40,200
later, therefore I'm going to copy this command, go back to my setup, run the install command, start

21
00:01:40,200 --> 00:01:49,830
up the server and then in the package JSON my should see somebody send grid forward e-mail and then

22
00:01:49,830 --> 00:01:57,060
pretty much the code is already prepared for us where essentially again they import the library, they

23
00:01:57,060 --> 00:02:01,850
set up the API key, which in our case is in the data entry.

24
00:02:01,860 --> 00:02:04,260
So we just use process data entry.

25
00:02:04,590 --> 00:02:05,880
We set up the message.

26
00:02:06,700 --> 00:02:13,280
Where we have to from subject text and e-mail, and then we just use the function to run it.

27
00:02:13,570 --> 00:02:18,630
So let's try it out where first I want to go back to send mail.

28
00:02:19,030 --> 00:02:24,220
And the first thing that I want to do is to rename this send email, because I do want to leave this

29
00:02:24,220 --> 00:02:25,060
for your reference.

30
00:02:25,690 --> 00:02:28,990
And since we are already exporting, send email.

31
00:02:29,210 --> 00:02:32,270
This is where I will set up the standard functionality.

32
00:02:32,530 --> 00:02:35,770
So let me just go here and say etherial.

33
00:02:36,070 --> 00:02:37,830
So that's going to be my function.

34
00:02:37,840 --> 00:02:44,440
Now, I do have a massive bug because at the moment I'm exporting something that doesn't exist.

35
00:02:44,770 --> 00:02:46,780
So let's create one from scratch.

36
00:02:47,110 --> 00:02:55,000
We're going to go with CONSED, send an email so that it's going to be our controller, a sankt rack

37
00:02:55,700 --> 00:03:04,390
rack and or as one we want to go back to the standard and line by line we'll just get the code.

38
00:03:04,660 --> 00:03:13,450
So first we want to set up the variable, just like we did with Meller when we want to create that API.

39
00:03:14,230 --> 00:03:21,130
So let's go over here and line in the sand email and you know, I'll collapse this just so we have a

40
00:03:21,130 --> 00:03:22,240
little bit more real estate.

41
00:03:22,570 --> 00:03:25,780
I'm going to copy and paste the set API key.

42
00:03:26,230 --> 00:03:34,720
Then what we're going to do is set up that message and eventually, of course, we'll call the sender

43
00:03:34,840 --> 00:03:35,380
as well.

44
00:03:35,650 --> 00:03:37,480
So I'm here as far as the message.

45
00:03:37,750 --> 00:03:40,540
Well, we need to come up with an actual email.

46
00:03:40,810 --> 00:03:46,150
That's where we want to send and in my case, I'm going to use one of my other dummy accounts for the

47
00:03:46,150 --> 00:03:50,740
courses and was going to learn code and email dot com.

48
00:03:51,130 --> 00:03:57,100
So me type learn code and mail dot com.

49
00:03:57,580 --> 00:04:05,110
Now as far as the from this one needs to match whatever you set up in that sender identity, otherwise

50
00:04:05,110 --> 00:04:06,330
you're going to get the error.

51
00:04:06,790 --> 00:04:17,070
My guess is I was to learn code tutorial at Gmail dot com and Gmail dot com and rest of devourers.

52
00:04:17,079 --> 00:04:22,270
I'm just going to leave it the way it is, just so we know that everything works online when it comes

53
00:04:22,270 --> 00:04:26,470
to this one, we can actually stick a weight in front of it.

54
00:04:26,890 --> 00:04:32,530
And then if we're successful, then we'll just send some dummy string back or, you know, what we can

55
00:04:32,530 --> 00:04:38,260
actually assign to some kind of variable and maybe try to do the same thing like we did over here.

56
00:04:38,560 --> 00:04:41,170
Remember to send email etherial.

57
00:04:41,500 --> 00:04:42,700
We send back the info.

58
00:04:42,940 --> 00:04:46,540
Let's try to do the same thing over here where I'm going to go with CONSED.

59
00:04:47,020 --> 00:04:53,120
I'll also call this info that is equal to my some good variable that send.

60
00:04:53,500 --> 00:04:55,180
So let's go here with rate.

61
00:04:55,450 --> 00:05:01,180
My variable name, Van Send will pass in the message here.

62
00:05:01,960 --> 00:05:09,360
And when it comes to response, let's just go with Meri's not Jason and let's send back the info now

63
00:05:09,400 --> 00:05:11,950
again the whole idea is to send an email.

64
00:05:12,040 --> 00:05:14,800
So let's see what we actually have back has an info.

65
00:05:15,010 --> 00:05:19,630
The most important part is to get that email in learn code.

66
00:05:20,080 --> 00:05:26,470
Hotmail dot com masey doesn't look like I have any errors that are always a good sign.

67
00:05:26,740 --> 00:05:31,930
So let me go back here to a new browser window and then let's send the email.

68
00:05:32,080 --> 00:05:36,610
I'll click it over here and complains that I'm not authorized.

69
00:05:36,970 --> 00:05:37,630
Interesting.

70
00:05:37,630 --> 00:05:38,710
Let me double check.

71
00:05:39,100 --> 00:05:46,570
And I think where the bug is shown here, they have sent it and back in my not the envy, of course

72
00:05:46,570 --> 00:05:48,580
I went with San Grid.

73
00:05:48,820 --> 00:05:49,930
So let me fix this.

74
00:05:49,930 --> 00:05:51,520
I'll restart the server.

75
00:05:52,060 --> 00:05:58,510
So let me go here with NPM start and let's try it one more time and go back to the home page.

76
00:05:58,540 --> 00:06:03,790
We'll click on send email and it looks like it was a success.

77
00:06:04,120 --> 00:06:05,950
So let me go back right now.

78
00:06:06,730 --> 00:06:12,460
As you can see here, I have an email from LERN called Tutorial Gmail dot com.

79
00:06:12,460 --> 00:06:19,040
Sending with some great is fun and easy to do anywhere, even with node jazz.

80
00:06:19,060 --> 00:06:19,510
Awesome.

81
00:06:19,720 --> 00:06:24,040
And that's how we can start sending emails with Sankaran again.

82
00:06:24,040 --> 00:06:30,550
As you can see, the setup is pretty much the same where we install a library that they provide.

83
00:06:31,000 --> 00:06:32,500
We set up here the key.

84
00:06:32,860 --> 00:06:39,040
And in this case, yes, you do want to use the process, not envy, because you don't want them to

85
00:06:39,040 --> 00:06:40,270
be publicly available.

86
00:06:40,510 --> 00:06:44,350
When you push this up to the curb, you definitely want to keep them secret.

87
00:06:44,530 --> 00:06:51,640
So always, always, always use the dart energy when we set up the message, same deal to from subject,

88
00:06:52,300 --> 00:06:58,540
either text or e-mail online, we just go with send our normal scenario.

89
00:06:58,750 --> 00:07:05,470
You're probably not going to send back the info to the user, but for testing purposes, I think that

90
00:07:05,470 --> 00:07:05,710
was.

91
00:07:05,810 --> 00:07:06,660
A OK.

92
00:07:06,920 --> 00:07:07,400
Awesome.

93
00:07:07,760 --> 00:07:11,830
We're done with this topic and now we're ready to move on to the next one.

