Skip to content

Instantly share code, notes, and snippets.

@fardeen9983
Created April 13, 2022 12:07
Show Gist options
  • Save fardeen9983/f128bb4294d4026c8eab2303ac27f791 to your computer and use it in GitHub Desktop.
Save fardeen9983/f128bb4294d4026c8eab2303ac27f791 to your computer and use it in GitHub Desktop.
Register Email Action
[HttpPost("register")]
public async Task<IActionResult> RegisterEmailSubscription([FromBody] string email)
{
if (string.IsNullOrEmpty(email))
{
return BadRequest(new { status = "Failed", message = "Enter a valid Email Address" });
}
else
{
await _notificationService.RegisterSubscirption(email);
return Ok(new { status = "success", message = "Email succesfully registered" });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment