email

package
v0.0.0-...-4660ec8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Content = map[Label]string{
	Social:            "An email which pertains to social networks or social events",
	Personal:          "An personal correspondance, contact, or communication.",
	Business:          "Emails related to commerce, trade, transactions, or other business activities.",
	Professional:      "Emails that pertain to your professional career or are work-related.",
	Finance:           "Emails dealing with monetary transactions, investments, or financial advice.",
	Bill:              "An email that contains a statement of money owed for goods or services.",
	Statement:         "An email that includes a detailed account statement, typically from financial institutions.",
	Receipt:           "An email that acknowledges the receipt of goods or services and the completion of a transaction.",
	OrderConfirmation: "An email confirming the details and acceptance of an order you have placed.",
	Shipping:          "An email providing information about the shipment of goods, including tracking details.",
	Marketing:         "Emails aimed at promoting products, services, or brands.",
	Sale:              "Emails that notify you of sales opportunities or special deals.",
	Discount:          "Emails offering reductions on regular prices of goods or services.",
	Health:            "Emails related to health services, medical information, or personal well-being.",
	Reminder:          "An email sent to prompt an action or recall an event, appointment, or task.",
	Education:         "Emails that contain educational content, learning resources, or academic information.",
	Coursework:        "Emails related to academic courses, assignments, or schoolwork.",
	Travel:            "Emails about travel arrangements, itineraries, and related promotions or information.",
	Invite:            "An email that invites you to an event, meeting, or social gathering.",
	Event:             "An email providing details about an upcoming event, including time, place, and agenda.",
	News:              "Emails that deliver news, updates on current affairs, or press releases.",
	Security:          "Emails concerning security alerts, privacy matters, or account protection.",
	OneTimeLogin:      "An email that provides a one-time login link or code for secure access.",
	ServiceUpdate:     "An email notifying you about updates, maintenance, or changes to a service you use.",
	ToDo:              "An email that lists tasks or actions that need to be completed.",
	Reference:         "An email that contains information or resources used for reference purposes.",
	Documents:         "An email that includes important documents or paperwork.",
	Spam:              "Unsolicited and often irrelevant emails, typically sent in bulk to a large number of users.",
	Other:             "An email that does not fit into the standard categories and is labeled as miscellaneous.",
}
View Source
var EmailTypes = map[Label]string{
	Correspondence: "An email from a sender of which you have responded too.",
	Solicitation:   "An email from an unknown sender that you have not engaged with.",
	Notification:   "A transactional email which is meant to notify you.",
	Alert:          "A transactional email which requires immediate attention.",
	Newsletter:     "A recurring email which is covers a given topic.",
	List:           "An email list",
}

Functions

func GetNewsletterName

func GetNewsletterName(e *Email) string

func IsList

func IsList(e *Email) bool

func IsNewsletter

func IsNewsletter(e *Email) bool

Types

type Body

type Body string

func (Body) Decode

func (b Body) Decode() (string, error)

type DomainStats

type DomainStats struct {
	Domain        string `json:"domain"`
	FromCount     int64  `json:"from_count"`
	ResponseCount int64  `json:"response_count"`
}

type Email

type Email struct {
	// Id: The immutable ID of the message.
	ID string `json:"id,omitempty"`

	// Received: The time at which the message was received by the server
	Received *time.Time `json:"received,omitempty"`

	// Headers: List of headers on this email
	Headers Headers `json:"headers,omitempty"`

	// Subject: The subject of the message.
	Subject string `json:"subject,omitempty"`

	// From: List of addresses from the `From` header.
	From string `json:"from,omitempty"`

	// To: List of addresses from the `To` header.
	To []string `json:"to,omitempty"`

	// CC: List of addresses from the `CC` header.
	CC []string `json:"cc,omitempty"`

	// BCC: List of addresses from the `BCC` header.
	BCC []string `json:"bcc,omitempty"`

	// Body: The entire email message in an RFC 2822 formatted and base64url
	Body Body `json:"body,omitempty"`

	// Filename: The filename of the attachment. Only present if this
	// message part represents an attachment.
	Filename string `json:"filename,omitempty"`

	// Snippet: A short part of the message text.
	Snippet string `json:"snippet,omitempty"`

	// Labels are used for classifying this email
	Labels []Label `json:"labels,omitempty"`
}

func (*Email) FromEmail

func (e *Email) FromEmail() string

type Headers

type Headers map[string]string

type Label

type Label string
const (
	// Email Types
	Correspondence Label = "correspondence"
	Solicitation   Label = "solicitation"
	Notification   Label = "notification"
	Alert          Label = "alert"
	Newsletter     Label = "newsletter"
	List           Label = "list"

	// Content Type
	Social            Label = "social"
	Personal          Label = "personal"
	Business          Label = "business"
	Professional      Label = "professional"
	Finance           Label = "finance"
	Bill              Label = "bill"
	Statement         Label = "statement"
	Receipt           Label = "receipt"
	OrderConfirmation Label = "order_confirmation"
	Shipping          Label = "shipping"
	Marketing         Label = "marketing"
	Sale              Label = "sale"
	Discount          Label = "discount"
	Health            Label = "health"
	Reminder          Label = "reminder"
	Education         Label = "education"
	Coursework        Label = "coursework"
	Travel            Label = "travel"
	Invite            Label = "invite"
	Event             Label = "event"
	News              Label = "news"
	Security          Label = "security"
	OneTimeLogin      Label = "one_time_login"
	ServiceUpdate     Label = "service_update"
	ToDo              Label = "todo"
	Reference         Label = "reference"
	Documents         Label = "documents"
	Spam              Label = "spam"
	Other             Label = "other"
)

type Statistics

type Statistics struct {
	TotalEmails int64                  `json:"total_emails"`
	DomainStats map[string]DomainStats `json:"domain_stats"`
}

Jump to

Keyboard shortcuts

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