Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated mail_data #151

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dao/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ func EventParticipantsNotification(ctx context.Context, i *models.Event, templat
}

for _, participant := range *participants {
mail := vcago.NewMailData(participant.User.Email, "pool-backend", template, participant.User.Country)
mail := vcago.NewMailData(participant.User.Email, "pool-backend", template, "pool", participant.User.Country)
mail.AddUser(participant.User.User())
mail.AddContent(participant.ToContent())
vcago.Nats.Publish("system.mail.job", mail)
//notification := vcago.NewMNotificationData(participant.User.Email, "pool-backend", template, participant.User.Country, token.ID)
//notification := vcago.NewMNotificationData(participant.User.Email, "pool-backend", template, "pool", participant.User.Country, token.ID)
//notification.AddUser(participant.User.User())
//notification.AddContent(participant.ToContent())
//vcago.Nats.Publish("system.notification.job", notification)
Expand All @@ -320,7 +320,7 @@ func EventASPNotification(ctx context.Context, i *models.Event, template string)
return
}

mail := vcago.NewMailData(user.Email, "pool-backend", template, user.Country)
mail := vcago.NewMailData(user.Email, "pool-backend", template, "pool", user.Country)
mail.AddUser(user.User())
mail.AddContent(i.ToContent())
vcago.Nats.Publish("system.mail.job", mail)
Expand All @@ -343,7 +343,7 @@ func EventStateNotification(ctx context.Context, i *models.Event, template strin
return
}

mail := vcago.NewMailData(eventAps.Email, "pool-backend", template, eventAps.Country)
mail := vcago.NewMailData(eventAps.Email, "pool-backend", template, "pool", eventAps.Country)
mail.AddUser(eventAps.User())
mail.AddContent(i.ToContent())
vcago.Nats.Publish("system.mail.job", mail)
Expand Down
6 changes: 3 additions & 3 deletions dao/participation.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func ParticipationNotification(ctx context.Context, i *models.Participation) (er
if i.Status == "rejected" {
template = "participation_reject"
}
mail := vcago.NewMailData(i.User.Email, "pool-backend", template, i.User.Country)
mail := vcago.NewMailData(i.User.Email, "pool-backend", template, "pool", i.User.Country)
mail.AddUser(i.User.User())
mail.AddContent(i.ToContent())
vcago.Nats.Publish("system.mail.job", mail)
Expand All @@ -154,7 +154,7 @@ func ParticipationCreateNotification(ctx context.Context, i *models.Participatio
if eventAps, err = UsersGetByID(ctx, &models.UserParam{ID: i.Event.EventASPID}); err != nil {
return
}
mail := vcago.NewMailData(eventAps.Email, "pool-backend", template, eventAps.Country)
mail := vcago.NewMailData(eventAps.Email, "pool-backend", template, "pool", eventAps.Country)
mail.AddUser(eventAps.User())
mail.AddContent(i.ToContent())
vcago.Nats.Publish("system.mail.job", mail)
Expand All @@ -172,7 +172,7 @@ func ParticipationWithdrawnNotification(ctx context.Context, i *models.Participa
if eventAps, err = UsersGetByID(ctx, &models.UserParam{ID: i.Event.EventASPID}); err != nil {
return
}
mail := vcago.NewMailData(eventAps.Email, "pool-backend", template, eventAps.Country)
mail := vcago.NewMailData(eventAps.Email, "pool-backend", template, "pool", eventAps.Country)
mail.AddUser(eventAps.User())
mail.AddContent(i.ToContent())
vcago.Nats.Publish("system.mail.job", mail)
Expand Down
4 changes: 2 additions & 2 deletions dao/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func RoleNotification(ctx context.Context, i map[string]*models.BulkUserRoles) (
); err != nil {
return
}
mail := vcago.NewMailData(user.Email, "pool-backend", "role_update", user.Country)
mail := vcago.NewMailData(user.Email, "pool-backend", "role_update", "pool", user.Country)
mail.AddUser(user.User())
mail.AddContent(user.RoleContent(role))
vcago.Nats.Publish("system.mail.job", mail)
Expand All @@ -166,7 +166,7 @@ func RoleAdminNotification(ctx context.Context, crewID *models.CrewParam) (err e
crew := new(models.Crew)
if err = CrewsCollection.FindOne(ctx, crewID.Match(), crew); err != nil {
}
mail := vcago.NewMailData("netzwerk@vivaconagua.org", "pool-backend", "role_network", "de")
mail := vcago.NewMailData("netzwerk@vivaconagua.org", "pool-backend", "role_network", "pool", "de")
mail.AddContent(models.RoleAdminContent(crew))
vcago.Nats.Publish("system.mail.job", mail)
return
Expand Down
2 changes: 1 addition & 1 deletion dao/user_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func ActiveNotification(ctx context.Context, i *models.Active, template string)
if err = CrewsCollection.FindOne(ctx, bson.D{{Key: "_id", Value: i.CrewID}}, &crew); err != nil {
return
}
mail := vcago.NewMailData(user.Email, "pool-backend", template, user.Country)
mail := vcago.NewMailData(user.Email, "pool-backend", template, "pool", user.Country)
mail.AddUser(user.User())
mail.AddContent(i.ToContent(crew))
vcago.Nats.Publish("system.mail.job", mail)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module pool-backend
go 1.17

require (
github.com/Viva-con-Agua/vcago v1.4.40
github.com/Viva-con-Agua/vcago v1.4.42
github.com/Viva-con-Agua/vcapool v0.3.4
github.com/google/uuid v1.3.0
github.com/labstack/echo/v4 v4.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Viva-con-Agua/vcago v1.4.16/go.mod h1:kxaxW9VYWIaCdWoM+PLHNwXmtPj4FPYHPxmPK6JsA1U=
github.com/Viva-con-Agua/vcago v1.4.40 h1:sZiDjbSjSwTUQnKXLdswFl3ybH0upy5u+NIpgkLnz2E=
github.com/Viva-con-Agua/vcago v1.4.40/go.mod h1:uJ7sBZk8IOEJbHgZ97uY+WE6TLMGkhiPvey3CxFOs4A=
github.com/Viva-con-Agua/vcago v1.4.42 h1:+UxsScecaZqEYTNbrUPHxc4Rn/wFJEayxDAjcJjnphU=
github.com/Viva-con-Agua/vcago v1.4.42/go.mod h1:uJ7sBZk8IOEJbHgZ97uY+WE6TLMGkhiPvey3CxFOs4A=
github.com/Viva-con-Agua/vcapool v0.3.4 h1:I1IGg7BTfXihMkTwLu+qYygcvfX9zZVMZw9+0B9ZJMs=
github.com/Viva-con-Agua/vcapool v0.3.4/go.mod h1:yTwmyj5DbsDduM23aEbK48BW0ONg9092hbmm1HhMso4=
github.com/acobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249/go.mod h1:iU1PxQMQwoHZZWmMKrMkrNlY+3+p9vxIjpZOVyxWa0g=
Expand Down