本文整理汇总了Golang中github.com/SparkPost/gosparkpost.Client.SuppressionDelete方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.SuppressionDelete方法的具体用法?Golang Client.SuppressionDelete怎么用?Golang Client.SuppressionDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/SparkPost/gosparkpost.Client
的用法示例。
在下文中一共展示了Client.SuppressionDelete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
//.........这里部分代码省略.........
if err != nil {
log.Fatalf("ERROR: %s\n\nFor additional information try using `--verbose true`\n\n\n", err)
return
} else {
csvEntryPrinter(e, false)
}
case "search":
parameters := make(map[string]string)
for i, val := range VALID_PARAMETERS {
if c.String(VALID_PARAMETERS[i]) != "" {
parameters[val] = c.String(val)
}
}
e, err := client.SuppressionSearch(parameters)
if err != nil {
log.Fatalf("ERROR: %s\n\nFor additional information try using `--verbose true`\n\n\n", err)
return
} else {
csvEntryPrinter(e, true)
}
case "delete":
recpipient := c.String("recipient")
if recpipient == "" {
log.Fatalf("ERROR: The `delete` command requires a recipient.")
return
}
_, err := client.SuppressionDelete(recpipient)
if err != nil {
log.Fatalf("ERROR: %s\n\nFor additional information try using `--verbose true`\n\n\n", err)
return
} else {
fmt.Println("OK")
}
case "mandrill":
fmt.Printf("Processing: %s\n", c.String("file"))
file := c.String("file")
if file == "" {
log.Fatalf("ERROR: The `mandrill` command requires a CSV file.")
return
}
f, err := os.Open(file)
check(err)
var entries = []sp.SuppressionEntry{}
batchCount := 1
blackListRow := csv.NewReader(bufio.NewReader(f))
blackListRow.FieldsPerRecord = 8
for {
record, err := blackListRow.Read()
if err == io.EOF {
break
}