You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
37 lines
1.3 KiB
using API_NetFramework.Controllers;
|
|
using API_NetFramework.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Web.Http;
|
|
|
|
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, "Mail versand noch nicht implementiert");
|
|
//return Content(HttpStatusCode.OK, empfaenger + ": Mail versandt");
|
|
}
|
|
}
|
|
}
|