@@ -22,20 +22,30 @@ func NotifyLicenseCreated(toEmail, userName, shortName string) {
2222 if Email == nil || ! Email .IsRunning () {
2323 return
2424 }
25-
25+ // sent mail to creator
2626 subject , html := templates .SingleLicenseEmailTemplate (
2727 userName ,
2828 "Created" ,
2929 time .Now (),
3030 shortName ,
3131 )
32-
32+ // email sent to admins
3333 _ = Email .Queue (ctx , EmailData {
3434 To : []string {toEmail },
35- Cc : admins ,
3635 Subject : subject ,
3736 HTML : html ,
3837 })
38+ Adminsubject , Adminhtml := templates .SingleLicenseEmailTemplate (
39+ "Admins" ,
40+ "Created" ,
41+ time .Now (),
42+ shortName ,
43+ )
44+ _ = Email .Queue (ctx , EmailData {
45+ To : admins ,
46+ Subject : Adminsubject ,
47+ HTML : Adminhtml ,
48+ })
3949 }()
4050}
4151
@@ -51,7 +61,7 @@ func NotifyLicenseUpdated(to, userName, licenseName string) {
5161 if Email == nil || ! Email .IsRunning () {
5262 return
5363 }
54-
64+ // sent mail to creator
5565 subject , html := templates .SingleLicenseEmailTemplate (
5666 userName ,
5767 "Updated" ,
@@ -62,11 +72,26 @@ func NotifyLicenseUpdated(to, userName, licenseName string) {
6272 data := EmailData {
6373 To : []string {to },
6474 Subject : subject ,
65- Cc : admins ,
6675 HTML : html ,
6776 }
6877
6978 _ = Email .Queue (ctx , data )
79+
80+ // email sent to admins
81+ Adminsubject , Adminhtml := templates .SingleLicenseEmailTemplate (
82+ "Admins" ,
83+ "Updated" ,
84+ time .Now (),
85+ licenseName ,
86+ )
87+
88+ Admindata := EmailData {
89+ To : admins ,
90+ Subject : Adminsubject ,
91+ HTML : Adminhtml ,
92+ }
93+
94+ _ = Email .Queue (ctx , Admindata )
7095 }()
7196}
7297
@@ -83,6 +108,7 @@ func NotifyImportSummary(to, userName, importedType string, total, success, fail
83108 return
84109 }
85110
111+ // email sent to the creator
86112 subject , html := templates .ImportSummaryEmailTemplate (
87113 userName ,
88114 importedType ,
@@ -95,10 +121,28 @@ func NotifyImportSummary(to, userName, importedType string, total, success, fail
95121 data := EmailData {
96122 To : []string {to },
97123 Subject : subject ,
98- Cc : admins ,
99124 HTML : html ,
100125 }
101126
102127 _ = Email .Queue (ctx , data )
128+
129+ // email sent to admins
130+ Adminsubject , Adminhtml := templates .ImportSummaryEmailTemplate (
131+ "Admins" ,
132+ importedType ,
133+ total ,
134+ success ,
135+ failed ,
136+ time .Now (),
137+ )
138+
139+ Admindata := EmailData {
140+ To : admins ,
141+ Subject : Adminsubject ,
142+ HTML : Adminhtml ,
143+ }
144+
145+ _ = Email .Queue (ctx , Admindata )
146+
103147 }()
104148}
0 commit comments