SimpleMailer: Index | Files

package SimpleMailer

import ""


Package Files

emailer.go simplemailer.go

func ReplaceContentText Uses

func ReplaceContentText(array map[string]interface{}, content string) string

function to replace variables as: {{USERNAME}} to USERNAME inside the html template. input as array of {"USERNAME": "gopher"}

func SendBulkEmails Uses

func SendBulkEmails(outgoing BulkSend) []map[string]interface{}

function to send multiple emails without any variables. good for sending a flat html email to many. uses BulkSend struct

func SendEmail Uses

func SendEmail(outgoingEmail Outgoing) bool

function to send an email with TLS and PlainAuth this function is ran multiple times in some scripts

func SendMultiple Uses

func SendMultiple(outgoing []Outgoing) []map[string]interface{}

function to send multiple emails with variables. uses and array of Outgoing structs

func SendSingle Uses

func SendSingle(outgoing Outgoing) bool

function to send a single email from Outgoing struct

func SetSMTPInfo Uses

func SetSMTPInfo(host string, port string, user string, password string, fromName string, fromAddress string, emailsDir string)

function to set the SMTP login information and email directory be sure to leave forward slash on end of email directory

type BulkSend Uses

type BulkSend struct {
    Emails   []string
    Subject  string
    Template string

Array of email addresses, subject for email, and .html template

type Config Uses

type Config struct {
    SMTPuser  string
    SMTPpass  string
    SMTPhost  string
    SMTPname  string
    SMTPfrom  string
    SMTPport  string
    EmailsDir string

configs for SMTP login information and email template directory

type Outgoing Uses

type Outgoing struct {
    Email     string
    Subject   string
    Template  string
    Variables Variables

A single email address, subject, .html template and array of Variables

type Variables Uses

type Variables struct {
    Inputs map[string]interface{}

variables in an array that will be replaced inside template USERNAME with text: {{USERNAME}} in the .html template

Package SimpleMailer imports 8 packages (graph). Updated 2017-02-15. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).