File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 44 "bytes"
55 "fmt"
66 "html/template"
7+ "net/http"
78
89 "github.com/factly/x/loggerx"
910 "github.com/sendgrid/sendgrid-go"
@@ -25,8 +26,21 @@ func SendmailwithSendGrid(data MailReceiver) error {
2526 to := mail .NewEmail (data .InviteeName , data .InviteeEmail )
2627 var body * template.Template
2728 var err error
28- body , err = template . ParseFiles ( "/app/util/email/template .html" )
29+ resp , err := http . Get ( "https://storage.googleapis.com/kavach.factly.in/templates/invite .html" )
2930 if err != nil {
31+ loggerx .Error (err )
32+ return err
33+ }
34+ defer resp .Body .Close ()
35+
36+ bodyContent , err := ioutil .ReadAll (resp .Body )
37+ if err != nil {
38+ loggerx .Error (err )
39+ return err
40+ }
41+ body , err = template .New ("invite" ).Parse (string (bodyContent ))
42+ if err != nil {
43+ loggerx .Error (err )
3044 return err
3145 }
3246 buf := new (bytes.Buffer )
You can’t perform that action at this time.
0 commit comments