update
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/smtp"
|
"net/smtp"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
@@ -76,9 +77,11 @@ func FormatSince(t time.Time) string {
|
|||||||
func SendEmail(to []string, cc []string, name, subject, message, htmlString string) error {
|
func SendEmail(to []string, cc []string, name, subject, message, htmlString string) error {
|
||||||
sender := "From: HIS <hats.nutech@gmail.com>\n"
|
sender := "From: HIS <hats.nutech@gmail.com>\n"
|
||||||
subjectt := "Subject: " + subject + "\n"
|
subjectt := "Subject: " + subject + "\n"
|
||||||
mime := "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
|
mime := "MIME-Version: 1.0\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
|
||||||
body := htmlString
|
body := htmlString
|
||||||
messages := []byte(sender + subjectt + mime + body)
|
emailTo := "To:" + strings.Join(to, ",") + "\n"
|
||||||
|
emailCC := "Cc: " + strings.Join(cc, ",") + "\n"
|
||||||
|
messages := []byte(sender + emailTo + emailCC + subjectt + mime + body)
|
||||||
|
|
||||||
for _, v := range cc {
|
for _, v := range cc {
|
||||||
if v != "" {
|
if v != "" {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<b>HIS</b>
|
<b>HIS</b>
|
||||||
</p>
|
</p>
|
||||||
<img
|
<img
|
||||||
src="http://36.66.3.44:7008/get-link?name=LOGO_HIS_NI_New_Contrasted-removebg-preview.png"
|
src="https://i.imgur.com/Stbilmj.png"
|
||||||
alt="logo"
|
alt="logo"
|
||||||
width="100px"
|
width="100px"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<div class="footer">
|
<div class="footer">
|
||||||
<p>Email ini dikirim oleh sistem.</p>
|
<p>Email ini dikirim oleh sistem.</p>
|
||||||
<img
|
<img
|
||||||
src="http://36.66.3.44:7008/get-link?name=LOGO_HIS_NI_New_Contrasted-removebg-preview.png"
|
src="https://i.imgur.com/Stbilmj.png"
|
||||||
alt="logo"
|
alt="logo"
|
||||||
width="100px"
|
width="100px"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<img
|
<img
|
||||||
src="http://36.66.3.44:7008/get-link?name=LOGO_HIS_NI_New_Contrasted-removebg-preview.png"
|
src="https://i.imgur.com/Stbilmj.png"
|
||||||
alt="logo"
|
alt="logo"
|
||||||
width="100px"
|
width="100px"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user