Skip to content

Instantly share code, notes, and snippets.

@scottsauber
Last active January 1, 2022 01:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save scottsauber/500c35e44beca2a33e4b8ffce4e8715a to your computer and use it in GitHub Desktop.
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using RazorHtmlEmails.Common;
namespace RazorHtmlEmails.AspNetCore.Pages;
public class IndexModel : PageModel
{
private readonly IRegisterAccountService _registerAccountService;
public IndexModel(IRegisterAccountService registerAccountService)
{
_registerAccountService = registerAccountService;
}
public async Task OnGetAsync()
{
// In reality, you would have this on a POST and pass along user input and not just have the Confirm Account link be the Index page... but #Demoware
await _registerAccountService.Register("testmctestyface@contoso.com", Url.Page("./Index"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment