- ABP Framework version: v9.X.X
- UI Type: Angular / MVC / Blazor WASM / Blazor Server
- Database System: SQL Server
- Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
- Exception message and full stack trace:
- Steps to reproduce the issue:
When an user created a new account, the confirm your email page shows, and there is a Verify button, before they click the button, a confirmation email was sent to their inbox, and if the users click the Verifiy button again, they receive another same email again. is there a way to avoid this? for instance, wait they click the Verify button before sending the first email; or check the email sent log(is there logs for this), if the same email has been sent, prevent the system to send it twice. any suggestions?
10 Answer(s)
-
0
-
0
If you want to check on the server side, you can try to override the
SendEmailConfirmationTokenAsync
method.[Dependency(ReplaceServices = true)] [ExposeServices(typeof(AccountAppService))] public class MyAccountAppService : AccountAppService { protected override async Task SendEmailConfirmationTokenAsync(IdentityUser user, string applicationName, string returnUrl, string returnUrlHash) { var isEmailSent = // get from cache or db. if(isEmailSent){ throw new UserfriendlyException("...") }else{ var confirmationToken = await UserManager.GenerateEmailConfirmationTokenAsync(user); await AccountEmailer.SendEmailConfirmationLinkAsync(user, confirmationToken, applicationName, returnUrl, returnUrlHash); // add confirmationToken to cache or db } } }
-
0
In the latest version, the button will be hidden to prevent multiple send email.
Which version?
-
0
Hi, 9.0.3
-
0
I upgraded to 9.0.3, it's still the same, the issue here is that the system automatically sends the first email, then this page loads and with this verifiy button. The user clicks the button, and at that point, a second email will be sent. Is there a way to detect that the system has sent the first email and prevent the button from being displayed?
-
0
I can't reproduce the problem.
Did you override the page and JS file?
Is there a way to detect that the system has sent the first email and prevent the button from being displayed?
See https://abp.io/support/questions/8676/how-to-avoid-sending-the-email-confirmation-email-twice#answer-3a1798e4-ae13-2b5c-d6b5-b6226abd84f1
-
0
no, I didn't override the page
-
0
Can you reproduce it in a new project?
abp new Testapp
-
0
yes, the same
-
0
yes, the same
please share the project with me. thanks. shiwei.liang@volosoft.com