aspnet / Templates

This repo is OBSOLETE - please see the README file for information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IEmailSender should have explicitly named parameters for html vs plain text

joeaudette opened this issue · comments

There have been a number of people reporting bugs about the email confirmation link in the StarterWeb template not working.

This is happening because people implement IEmailSender and don't realize that the message being passed in is html. When they send the email as plain text the confirmation link does not work because of the url encoding.

I think the "message" parameter of SendEmailAsync should be renamed to htmlMessage and possibly should have an additional parameter for "plainTextMessage" and both should be passed in from AccountController.

This would make it more clear to implementors of IEmailSender what kind of string(s) they are dealing with and how to correctly implement it.

related issues:
dotnet/aspnetcore#2152
dotnet/aspnetcore#2217

This issue was moved to aspnet/Templating#79