Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodySectionContent ¶
type BodySectionContent struct { PubName string Items []linksrc.LinkItem Overview string // General statement about the links scraped for the site }
BodySectionContent is used to populate email body templates
func NewBodySectionContent ¶
func NewBodySectionContent(s linksrc.Set) BodySectionContent
NewBodySectionContent readies a linksrc.Set for inclusion in an email body. We want to keep linksrc.Set as close as possible to what a scraper had originally parsed, and BodySectionContent as close as possible to what a reader would want to see, while decoupling the two.
type EmailData ¶
type EmailData struct {
// contains filtered or unexported fields
}
EmailData contains metadata for the body of an email to send with a newsletter etc. Since each linksrc.Set in linksets comes from a different upstream, this is designed to support concurrent access. You should create this with NewEmailData.
func (*EmailData) Add ¶
Add stores a new linksrc.Set in the EmailData in a goroutine-safe way. Callers must use Add for adding linksrc.Sets to the EmailData.
func (*EmailData) GenerateBody ¶
GenerateBody produces an HTML email body to send based on the unformatted content. It's meant to include multiple sources of links in the same email to reduce the number of emails we send. Any scraping- or parsing- related error messages are included in the text.
func (*EmailData) GenerateText ¶
GenerateText produces an email body to send based on the unformatted content, satisfying the text/plain MIME type. It's meant to include multiple sources of links in the same email to reduce the number of emails we send. Any scraping- or parsing- related error messages are included in the text.