package modules import ( "html" "golang-fave/engine/assets" "golang-fave/engine/builder" "golang-fave/engine/consts" "golang-fave/engine/sqlw" "golang-fave/engine/utils" "golang-fave/engine/wrapper" ) func (this *Modules) RegisterModule_NotifyMail() *Module { return this.newModule(MInfo{ Mount: "notify-mail", Name: "Mail notifier", Order: 803, System: true, Icon: assets.SysSvgIconEmail, Sub: &[]MISub{ {Mount: "default", Name: "All", Show: true, Icon: assets.SysSvgIconList}, {Mount: "success", Name: "Success", Show: true, Icon: assets.SysSvgIconList}, {Mount: "in-progress", Name: "In progress", Show: true, Icon: assets.SysSvgIconList}, {Mount: "error", Name: "Error", Show: true, Icon: assets.SysSvgIconList}, }, }, nil, func(wrap *wrapper.Wrapper) (string, string, string) { content := "" sidebar := "" if wrap.CurrSubModule == "" || wrap.CurrSubModule == "default" || wrap.CurrSubModule == "success" || wrap.CurrSubModule == "in-progress" || wrap.CurrSubModule == "error" { ModuleName := "All" ModulePagination := "/cp/" + wrap.CurrModule + "/" ModuleSqlWhere := "" if wrap.CurrSubModule == "success" { ModuleName = "Success" ModulePagination = "/cp/" + wrap.CurrModule + "/success/" ModuleSqlWhere = " WHERE fave_notify_mail.status = 1" } else if wrap.CurrSubModule == "in-progress" { ModuleName = "In progress" ModulePagination = "/cp/" + wrap.CurrModule + "/in-progress/" ModuleSqlWhere = " WHERE fave_notify_mail.status = 2 OR fave_notify_mail.status = 3" } else if wrap.CurrSubModule == "error" { ModuleName = "Error" ModulePagination = "/cp/" + wrap.CurrModule + "/error/" ModuleSqlWhere = " WHERE fave_notify_mail.status = 0" } content += this.getBreadCrumbs(wrap, &[]consts.BreadCrumb{ {Name: ModuleName}, }) content += builder.DataTable( wrap, "fave_notify_mail", "id", "DESC", &[]builder.DataTableRow{ { DBField: "id", }, { DBField: "email", NameInTable: "Email / Subject", CallBack: func(values *[]string) string { subject := html.EscapeString((*values)[2]) if subject != "" { subject = `