Created
April 13, 2022 12:07
-
-
Save fardeen9983/f128bb4294d4026c8eab2303ac27f791 to your computer and use it in GitHub Desktop.
Register Email Action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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