run go fmt
parent
3de25244fb
commit
b35ac045f3
32
main.go
32
main.go
|
@ -113,7 +113,7 @@ func retrieveSubscribers(cfg *Config) ([]string, error) {
|
|||
return nil, errors.New("response format error: 'emails' field not found")
|
||||
}
|
||||
|
||||
/* De-duplicate emails using a map */
|
||||
/* De-duplicate emails using a map */
|
||||
/* *** */
|
||||
emailMap := make(map[string]bool)
|
||||
for _, email := range emails {
|
||||
|
@ -282,12 +282,12 @@ func blastMail(cfg *Config, logFile string, trackingFile string, audience []stri
|
|||
}
|
||||
}
|
||||
|
||||
existingReaderCount := len(sentToAddresses)
|
||||
newReaderCount := 0
|
||||
existingReaderCount := len(sentToAddresses)
|
||||
newReaderCount := 0
|
||||
|
||||
if existingReaderCount > 0 {
|
||||
fmt.Println("Same email file specified: Sending only to new subscribers...")
|
||||
}
|
||||
if existingReaderCount > 0 {
|
||||
fmt.Println("Same email file specified: Sending only to new subscribers...")
|
||||
}
|
||||
|
||||
var group []string
|
||||
for _, a := range audience {
|
||||
|
@ -314,7 +314,7 @@ func blastMail(cfg *Config, logFile string, trackingFile string, audience []stri
|
|||
for i, res := range results {
|
||||
log.WriteString(fmt.Sprintf("%s: %s\n", group[i], res.Message))
|
||||
}
|
||||
newReaderCount += len(group)
|
||||
newReaderCount += len(group)
|
||||
group = group[0:0]
|
||||
}
|
||||
}
|
||||
|
@ -330,17 +330,17 @@ func blastMail(cfg *Config, logFile string, trackingFile string, audience []stri
|
|||
for i, res := range results {
|
||||
log.WriteString(fmt.Sprintf("%s: %s\n", group[i], res.Message))
|
||||
}
|
||||
newReaderCount += len(group)
|
||||
newReaderCount += len(group)
|
||||
}
|
||||
|
||||
if newReaderCount > 0 {
|
||||
newSubscribers := existingReaderCount > 0
|
||||
if newSubscribers {
|
||||
fmt.Printf("Sent to %d new subscribers!\n", newReaderCount)
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("Not sent (no new subscribers)\n")
|
||||
}
|
||||
if newReaderCount > 0 {
|
||||
newSubscribers := existingReaderCount > 0
|
||||
if newSubscribers {
|
||||
fmt.Printf("Sent to %d new subscribers!\n", newReaderCount)
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("Not sent (no new subscribers)\n")
|
||||
}
|
||||
}
|
||||
|
||||
var postmarkClient = http.Client{}
|
||||
|
|
Loading…
Reference in New Issue