emailer

package
v0.0.0-...-0be70c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package emailer is responsible for sending out a feed item via email.

There are two ways emails are sent:

  1. Via spawning /usr/sbin/sendmail.

  2. Via SMTP.

The choice is made based upon the presence of environmental variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emailer

type Emailer struct {
	// contains filtered or unexported fields
}

Emailer stores our state

func New

func New(feed *gofeed.Feed, item withstate.FeedItem, opts []configfile.Option, log *slog.Logger) *Emailer

New creates a new Emailer object.

The arguments are the source feed, the feed item which is being notified, and any associated configuration values from the source feed.

func (*Emailer) Sendmail

func (e *Emailer) Sendmail(addresses []string, textstr string, htmlstr string) error

Sendmail is a simple function that emails the given address.

We send a MIME message with both a plain-text and a HTML-version of the message. This should be nicer for users.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL