// SendText sends any type of text
SendText sends any type of text
// SendText sends any type of text
func (s *TextSenderParams) SendText(ctx *gin.Context, data models.TextData) error {
	sess, err := session.NewSession(&aws.Config{
		Region: aws.String("eu-west-1")},
	)
	creds := credentials.NewStaticCredentials(s.apiID, s.apiKey, "")
	svc := sns.New(sess, &aws.Config{Credentials: creds})
	params := &sns.PublishInput{
		Subject:     aws.String(data.Subject),
		Message:     aws.String(data.Message),
		PhoneNumber: aws.String(data.PhoneNumber),
	}
	_, err = svc.Publish(params)
	if err != nil {
		logrus.Warnln(err.Error())
		return err
	}
	return nil
}
func ( s * TextSenderParams ) SendText ( ctx * gin . Context , data models . TextData ) error { sess , err := session . NewSession ( & aws . Config { Region : aws . String ( " " ) } , ) creds := credentials . NewStaticCredentials ( s . apiID , s . apiKey , " " ) svc := sns . New ( sess , & aws . Config { Credentials : creds } ) params := & sns . PublishInput { Subject : aws . String ( data . Subject ) , Message : aws . String ( data . Message ) , PhoneNumber : aws . String ( data . PhoneNumber ) , } _ , err = svc . Publish ( params ) if err != nil { logrus . Warnln ( err . Error ( ) ) return err } return nil }
SendText sends any type of text
SendText sends any type of text
// logrus.Infoln("Amazon Creds: " + s.apiID + s.apiKey) // Creates an SES session. // Assembling the text and attempting to send the email. // logrus.Infoln("SNS Text Sent to " + data.PhoneNumber) // logrus.Infoln(resp)