Hi, everyone, and welcome back.
Now in today's video, we are going to discuss about the SES templates.
So first let's understand the basics of email template.
So at a high level overview and email template is a pre defined email layout.
So let's assume that there are 1000 users and you are planning to send a very similar mail to all of
the 1000 users.
So in such cases you will first create an email layout and then you modify certain aspects like the
name of the users in the final email that you send.
So rather than creating a new email from scratch every time you can use the base template and then modify
certain aspects like the username before sending it to the users.
So let's understand this with a diagram where you have an email template.
In here you have high followed by a variable of name and you have thanks for registration and this is
associated with the SES and then you're sending it to the users.
Now you are not going to send the exact email like this.
You will be replacing this variable of name with the actual name of the users before sending it.
However, your template remains to be the same.
Now from the diagrammatic perspective, this is a very simple template, but in organizations you might
have more complex template based on HTML and various others.
So when we discuss about using templates in SES, note that you have to make use of a create template
API operation to create the email templates.
Now at this stage the A plus does not support the creation of templates using the G, and that is the
reason why API operation is currently supported.
So when we discuss about these templates, it includes subject line as well as text and the HTML parts
of the email body.
So if you look into this specific screenshot, I have one template that is created as my template,
and within this template you have the subject part, you have the text part, you have the HTML part,
and you see there are multiple set of variables like name, favorite animal and others.
And this is the variables that will be replaced before the email is finally sent to the users.
So with this basic set, let's jump into a quick demo to understand things in more detail.
Now, going back to the SES console, currently I have an email template that is already available,
calls my template now from the CLA.
If we look into the template that is available, which is my template, if you want to look into the
contents, these are the contents very similar to the screenshot.
You have the subject part, text part, and the HTML part with certain set of variables over here.
Now the next part is to go ahead and send a personalized email where all of those variables will be
replaced.
So in such cases you can use the send template email operation to send the email to a single destination.
Again, there are multiple ways to send it to multiple destinations as well.
So in such case you can include the values associated with the variables as part of that template data.
For example, what do you do?
You have a template data and within you replace the variable.
For example, name as favorite animal is elephant and other thing remains to be the same.
You have the source, you have the destination, you have the template name and so on.
So let's also try it out.
Now, similar to a screenshot, I have a file called test hyphen email or JSON where I have added all
of the appropriate data.
And from the CLA we'll run the places, send templated email and within will specify a file.
The file name is test email JSON.
So I'll say test email, JSON and we got the appropriate message ID and from my email here, you see
we got Greetings Z Hello Z and your favorite animal is Elephant.
So this part of XL and elephant are the variables that got replaced.
All right.
So I hope with this at an overview you understood the basics of the SES templates and with this will
conclude today's video.