Skip to content

Latest commit

 

History

History
73 lines (61 loc) · 2.09 KB

README.md

File metadata and controls

73 lines (61 loc) · 2.09 KB

SMTP Setup

  1. Provide your email server and port settings in the config.yaml under providers.smtp.
  2. Comment out or leave username and password blank if using an unauthenticated smtp server.
  3. Add the from address and 1 or more to addresses.
  4. Optionally override the Email Subject.
  5. Optionaly provide a customTemplate (path to file). See Custom Template for more info.

Example Config

  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

Default Template

The default email template looks like this:

AWS News default email template

The footer can be customized in the config.yaml providers.smtp.footer. For more customization see custom template.

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 )