Skip to content

Commit

Permalink
env fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MeesvanStraten committed Nov 25, 2021
1 parent b0e8323 commit fc85f6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions API/Controllers/ProjectController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,10 @@ public async Task<IActionResult> InitiateTransfer(string potentialNewOwnerUserEm
.ConfigureAwait(false);


if(user == null)
{
return NotFound("Could not find current user");
}

if(project.UserId != user.Id)
{
Expand All @@ -1548,11 +1552,11 @@ public async Task<IActionResult> InitiateTransfer(string potentialNewOwnerUserEm
return NotFound(problem);
}

string responseString = "";
string responseString = "123";
try
{
Response response = await projectTransferService.InitiateTransfer(project, potentialNewOwner);
responseString = response.StatusCode.ToString() + response.Body.ToString();
if(response != null) responseString = response.StatusCode.ToString() + response.Body.ToString();
if(response.StatusCode == HttpStatusCode.Accepted)
{
return Ok("Transfer has been initiated, please check your email");
Expand Down
4 changes: 2 additions & 2 deletions Services/Resources/MailClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class MailClient
//This class might be temporary untill the RabbitMQ emailSender has been fixed
public MailClient()
{
//sendGridClient = new SendGridClient(Environment.GetEnvironmentVariable("App__SendGrid__ApiKey"));
//fromEmailAdress = new EmailAddress(Environment.GetEnvironmentVariable("App__SendGrid__EmailFrom"));
sendGridClient = new SendGridClient(Environment.GetEnvironmentVariable("App__SendGrid__ApiKey"));
fromEmailAdress = new EmailAddress(Environment.GetEnvironmentVariable("App__SendGrid__EmailFrom"));
}

public async Task<Response> SendMail(string receiverAdress, string plainTextContent,string subject, string htmlContent)
Expand Down

0 comments on commit fc85f6c

Please sign in to comment.