Ejemplo n.º 1
0
func GetProductionMTAContainer() (mtacontainer.MTAContainer, mtacontainer.Scheduler) {
	var passphrase = GetPassphraseFromArgOrTerminal()
	var mailGunConfig = mailgunprovider.BitLabConfig(passphrase)
	var amazonConfig = amazonsesprovider.BitLabConfig(passphrase)
	var sendgridConfig = sendgridprovider.BitLabConfig(passphrase)
	providers := make([]mtacontainer.MTAProvider, 3)
	providers[0] = mailgunprovider.New(utilities.GetLogger("MailGun"), mailGunConfig, mtacontainer.NewThressHoldFailureStrategy(ERROR_THRESHOLD))
	providers[1] = amazonsesprovider.New(utilities.GetLogger("amazonSES"), amazonConfig, mtacontainer.NewThressHoldFailureStrategy(ERROR_THRESHOLD))
	providers[2] = sendgridprovider.New(utilities.GetLogger("SendGrid"), sendgridConfig, mtacontainer.NewThressHoldFailureStrategy(ERROR_THRESHOLD))
	var scheduler mtacontainer.Scheduler = mtacontainer.NewRoundRobinScheduler(providers)
	return mtacontainer.New(scheduler), scheduler
}
Ejemplo n.º 2
0
func main() {

	if len(os.Args) < 3 {
		println("manual_test <to address> <key>")
		return
	}

	to := os.Args[1]
	key := os.Args[2]

	amazonMTAProvider := amazonsesprovider.New(utilities.GetLogger("Amazon"),
		amazonsesprovider.BitLabConfig(key), test.NewMockFailureStrategy())
	test.ManuallyVerifyEmailSend(amazonMTAProvider, to)
}