Browse Source

Added event on sending email error. Fixes #99

pull/105/head
Jordan Wright 5 years ago
parent
commit
17e81e6caa
3 changed files with 11 additions and 0 deletions
  1. +1
    -0
      models/models.go
  2. +6
    -0
      static/js/app/campaign_results.js
  3. +4
    -0
      worker/worker.go

+ 1
- 0
models/models.go View File

@ -30,6 +30,7 @@ const (
CAMPAIGN_EMAILS_SENT string = "Emails Sent"
CAMPAIGN_COMPLETE string = "Completed"
EVENT_SENT string = "Email Sent"
EVENT_SENDING_ERROR string = "Error Sending Email"
EVENT_OPENED string = "Email Opened"
EVENT_CLICKED string = "Clicked Link"
STATUS_SUCCESS string = "Success"

+ 6
- 0
static/js/app/campaign_results.js View File

@ -32,6 +32,12 @@ var statuses = {
label: "label-default",
icon: "fa-times"
},
"Error Sending Email": {
slice: "ct-slice-donut-error",
legend: "ct-legend-error",
label: "label-default",
icon: "fa-times"
},
"Unknown": {
slice: "ct-slice-donut-error",
legend: "ct-legend-error",

+ 4
- 0
worker/worker.go View File

@ -115,6 +115,10 @@ func processCampaign(c *models.Campaign) {
if err != nil {
Logger.Println(err)
}
err = c.AddEvent(models.Event{Email: t.Email, Message: models.EVENT_SENDING_ERROR})
if err != nil {
Logger.Println(err)
}
} else {
err = t.UpdateStatus(models.EVENT_SENT)
if err != nil {

Loading…
Cancel
Save