update 20241202
This commit is contained in:
@@ -11,15 +11,26 @@ namespace OnDocAPI_NetFramework.Controllers
|
||||
{
|
||||
public class MailController : ApiController
|
||||
{
|
||||
string tokenfunction = "Mail";
|
||||
|
||||
[HttpGet]
|
||||
[Route("API/SendMail")]
|
||||
public IHttpActionResult SendMail(string empfaenger, string betreff, string message, string dokumentid, string ondoclink)
|
||||
{
|
||||
|
||||
APILogging.Log((HttpRequestMessage)Request, "Mailversand: " + empfaenger+""+betreff, LogLevelType.Debug);
|
||||
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
|
||||
{
|
||||
return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
}
|
||||
if (!empfaenger.ToUpper().Contains("@TKB.CH"))
|
||||
{
|
||||
return Content(HttpStatusCode.Forbidden, empfaenger + ": Email nicht bei der TKB - Mail nicht versandt");
|
||||
}
|
||||
|
||||
|
||||
|
||||
return Content(HttpStatusCode.OK, empfaenger + ": Mail versandt");
|
||||
return Content(HttpStatusCode.OK, "Mail versand noch nicht implementiert");
|
||||
//return Content(HttpStatusCode.OK, empfaenger + ": Mail versandt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user