- Provide your email server and port settings in the config.yaml under
providers.smtp
. - Comment out or leave
username
andpassword
blank if using an unauthenticated smtp server. - Add the
from
address and 1 or moreto
addresses. - Optionally override the Email Subject.
- Optionaly provide a
customTemplate
(path to file). See Custom Template for more info.
smtp:
enabled: true
server: "smtp.gmail.com"
port: "587"
username: "[email protected]"
password: "abcdefghijklmno"
subject: "AWS News"
footer: "Brought to you by <a href='https://github.com/circa10a/go-aws-news'>go-aws-news</a>"
from: "[email protected]"
to:
- "[email protected]"
- "[email protected]"
# customTemplate: /path/to/email.html
The default email template looks like this:
The footer can be customized in the config.yaml providers.smtp.footer
. For more
customization see custom template.
To provide a custom email html template, start with the defaultTemplate
included in the code
and build from there:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
.footer {
text-align: center;
}
.footer p {
margin-top: 40px;
}
</style>
</head>
<body>
<h3>AWS News for {{ .Date }}:</h3>
{{ .News }}
<div class="footer">
<p>{{ .Footer }}</p>
</div>
</body>
</html>
There are 3 keys available to use:
Date |
The date of yesterday's news. |
News |
The AWS News in an unordered list of links. |
Footer |
Custom footer (overridable in config.yaml ) |