Esempio n. 1
0
func (notifier EmailNotifier) ExecuteNotifier(request *messaging.NotifierRequest) messaging.NotifierResponse {
	var response = messaging.NotifierResponse{}
	securityToken := request.Controls.SecurityToken
	namespace := request.Controls.Namespace
	class := request.Controls.Class
	templateId := request.Parameters["templateId"].(string)
	inputParameters := request.Parameters["parameters"].(map[string]string)
	var reciever string
	reciever = ""
	var recievers map[int]string

	if request.Parameters["reciever"] != nil {
		reciever = request.Parameters["reciever"].(string)
	}

	if request.Parameters["cc_mail"] != nil {
		recievers = request.Parameters["cc_mail"].(map[int]string)
	}

	if recievers == nil && (reciever == "" || reciever == " ") {
		response.Message = "No Recievers included"
		response.IsSuccess = false
	} else {

		response.IsSuccess = send(request, securityToken, namespace, class, templateId, inputParameters, reciever, recievers)

		if response.IsSuccess {
			response.Message = "All Emails sent Successfully!"
		} else {
			response.Message = "Email sending Failure. Check parameters and connection!"
		}
	}

	return response
}
Esempio n. 2
0
func (notifier SMSNotifier) ExecuteNotifier(request *messaging.NotifierRequest) messaging.NotifierResponse {
	var temp = messaging.NotifierResponse{}
	temp.IsSuccess = false
	temp.Message = "Not Implemented in SMSNotifier."
	return temp
}