Move comms work to background goroutine
This is a sort of random checkpoint of work * add schema for tracking messages sent to DB * add terms of service and privacy policy for RCS compliance * standardize some things about background workers * update some missing stuff from generated DB code
This commit is contained in:
parent
8f44e57c72
commit
842e6cff43
47 changed files with 7361 additions and 179 deletions
|
|
@ -131,15 +131,15 @@ func renderOrError(w http.ResponseWriter, template *builtTemplate, context inter
|
|||
buf.WriteTo(w)
|
||||
}
|
||||
|
||||
func sendEmail(email emailRequest) (response emailResponse, err error) {
|
||||
url := "https://api.forwardemail.net/v1/emails"
|
||||
var FORWARDEMAIL_API = "https://api.forwardemail.net/v1/emails"
|
||||
|
||||
func sendEmail(email emailRequest) (response emailResponse, err error) {
|
||||
payload, err := json.Marshal(email)
|
||||
if err != nil {
|
||||
return response, fmt.Errorf("Failed to marshal email request: %w", err)
|
||||
}
|
||||
|
||||
req, _ := http.NewRequest("POST", url, bytes.NewReader(payload))
|
||||
req, _ := http.NewRequest("POST", FORWARDEMAIL_API, bytes.NewReader(payload))
|
||||
req.SetBasicAuth(config.ForwardEmailAPIToken, "")
|
||||
req.Header.Add("Content-Type", "application/json")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue