func CreateSmsOut(golog syslog.Writer, db sql.DB, mainos []domains.MainosTel, aclientsforsendout []domains.MainosTel) { for _, telmainos := range aclientsforsendout { phoneout, newsmstext := checkSMSText(golog, mainos, telmainos.Text) sqlstr := "update aclients set nmake='" + newsmstext + "',nupdate_make=now() where phone='" + telmainos.Phone + "'" fmt.Println(sqlstr) sql2.UpdateAclient(golog, db, sqlstr) var smsout domains.Smsout smsout.Phoneto = strings.Replace(telmainos.Phone, "0", "+358", 1) smsout.Text = newsmstext + " " + phoneout smsout.Phonefrom = phoneout smsout.Opcode = "notImpotent" smsout.Nmake = "notImpotent" fmt.Println(smsout) smsproviders.SmsSendBy("voicetr", smsout, golog) time.Sleep(2000 * time.Millisecond) fmt.Println("Sleep") } }
func Send(golog syslog.Writer, phoneto string, phonefrom string, text string) { var smsout domains.Smsout smsout.Phoneto = phoneto smsout.Text = text smsout.Phonefrom = phonefrom smsout.Opcode = "notImpotent" smsout.Nmake = "notImpotent" pr.SmsSendBy("voicetr", smsout, golog) }
func SendSMS(golog syslog.Writer, clphonenum string, text string, site string) { var smsout d.Smsout if text == "" { golog.Info("Send first SMS on " + clphonenum) smsout.Phoneto = strings.Replace(clphonenum, "358", "0", 1) smsout.Text = "Soita! Miia. puh. 070095943" smsout.Phonefrom = "070095943" smsout.Opcode = "notImpotent" smsout.Nmake = "notImpotent" } else { golog.Info("Send Second SMS on " + clphonenum + " " + text) smsout.Phoneto = strings.Replace(clphonenum, "358", "0", 1) smsout.Text = text smsout.Phonefrom = "070095943" smsout.Opcode = "notImpotent" smsout.Nmake = "notImpotent" } pr.SmsSendBy("sonera", smsout, golog) }