|
6 | 6 | "time" |
7 | 7 |
|
8 | 8 | "github.com/UDCS/Autograder/models" |
| 9 | + "github.com/UDCS/Autograder/utils/config" |
9 | 10 | "github.com/UDCS/Autograder/utils/email" |
10 | 11 | "github.com/UDCS/Autograder/utils/jwt_token" |
11 | 12 | "github.com/UDCS/Autograder/utils/logger" |
@@ -38,10 +39,12 @@ func (app *GraderApp) CreateInvitation(jwksToken string, invitation models.Invit |
38 | 39 | return nil, err |
39 | 40 | } |
40 | 41 |
|
| 42 | + baseUrl := config.GetBaseURL() |
| 43 | + |
41 | 44 | // TODO: email the invitation with the link containg both token and invitation I |
42 | 45 | //email.Send("auth/register/" + invitation.Id.String() + "?token=" + token) |
43 | 46 | //msg := "Subject: Create an Autograder Account\n\nYour professor has invited you to create an Autograder account.\n\nYou may create the account be visitting auth/regiser/" + invitation.Id.String() + "?token=" + token + "\n\nThis email cannot be replied to. If you have any questions, please contact your professor." |
44 | | - msg := fmt.Sprintf("Subject: Create an Autograder Account\nYour professor has invited you to create an Autograder account.\n\nYou may create the account be visitting https://udcs-autograder.web.app/auth/regiser/%s?token=%s\n\nThis email cannot be replied to. If you have any questions, please contact your professor.", invitation.Id.String(), token) |
| 47 | + msg := fmt.Sprintf("Subject: Create an Autograder Account\nYour professor has invited you to create an Autograder account.\n\nYou may create the account be visiting %s/signup?id=%s&token=%s\n\nThis email cannot be replied to. If you have any questions, please contact your professor.", baseUrl, invitation.Id.String(), token) |
45 | 48 | err = email.Send(invitation.Email, msg) |
46 | 49 | if err != nil { |
47 | 50 | fmt.Print(err.Error()) |
@@ -77,7 +80,8 @@ func (app *GraderApp) InviteAdmin(invitation models.Invitation) (*models.Invitat |
77 | 80 | "Subject: Create an Admin Autograder Account\n\nAn Autograder admin has invited you to create an admin Autograder account.\n\nYou may create the account be visitting auth/regiser/" |
78 | 81 | + invitation.Id.String() + "?token=" + token + |
79 | 82 | "\n\nThis email cannot be replied to. If you have any questions, please contact the admin."*/ |
80 | | - msg := fmt.Sprintf("Subject: Create an Admin Autograder Account\nAn Autograder admin has invited you to create an Autograder account.\n\nYou may create the account be visitting https://udcs-autograder.web.app/auth/regiser/%s?token=%s\n\nThis email cannot be replied to. If you have any questions, please contact the admin.", invitation.Id.String(), token) |
| 83 | + baseUrl := config.GetBaseURL() |
| 84 | + msg := fmt.Sprintf("Subject: Create an Admin Autograder Account\nAn Autograder admin has invited you to create an Autograder account.\n\nYou may create the account be visiting %s/signup?id=%s&token=%s\n\nThis email cannot be replied to. If you have any questions, please contact the admin.", baseUrl, invitation.Id.String(), token) |
81 | 85 | err = email.Send(invitation.Email, msg) |
82 | 86 |
|
83 | 87 | if err != nil { |
|
0 commit comments