Skip to content

Instantly share code, notes, and snippets.

@Wanchai
Created December 31, 2019 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wanchai/2f5242d0527f54a7da7af6b9d8b58fe8 to your computer and use it in GitHub Desktop.
Save Wanchai/2f5242d0527f54a7da7af6b9d8b58fe8 to your computer and use it in GitHub Desktop.
using MailerApi.Services;
using Microsoft.AspNetCore.Mvc;
namespace MailerApi.Controllers
{
[ApiController]
[Route("[controller]")]
public class TestController : ControllerBase
{
EmailerService Mailer { get; }
public TestController(EmailerService mailer)
{
Mailer = mailer;
}
[HttpGet]
public IActionResult Get()
{
Mailer.Send("Mister Test", "test@mail.com", "Hi, it's me.", "My plain text content", "<p>My HTML content</p>");
return Ok("ok");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment