locale
This commit is contained in:
parent
ed75f6f55c
commit
4f6898d18a
3 changed files with 22 additions and 3 deletions
|
|
@ -224,8 +224,8 @@ namespace Yavsc.Controllers
|
||||||
// Send an email with this link
|
// Send an email with this link
|
||||||
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
||||||
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
|
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
|
||||||
var emailSent = await _emailSender.SendEmailAsync(_siteSettings, _smtpSettings, model.Email, "Confirm your account",
|
var emailSent = await _emailSender.SendEmailAsync(_siteSettings, _smtpSettings, model.Email, _localizer["ConfirmYourAccountTitle"],
|
||||||
"Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>");
|
string.Format(_localizer["ConfirmYourAccountBody"] , _siteSettings.Title, callbackUrl, _siteSettings.Slogan, _siteSettings.Audience));
|
||||||
await _signInManager.SignInAsync(user, isPersistent: false);
|
await _signInManager.SignInAsync(user, isPersistent: false);
|
||||||
if (!emailSent) {
|
if (!emailSent) {
|
||||||
_logger.LogWarning("User created with error sending email confirmation request");
|
_logger.LogWarning("User created with error sending email confirmation request");
|
||||||
|
|
@ -250,11 +250,16 @@ namespace Yavsc.Controllers
|
||||||
[Authorize,HttpPost,ValidateAntiForgeryToken]
|
[Authorize,HttpPost,ValidateAntiForgeryToken]
|
||||||
public async Task <IActionResult> SendEMailForConfirm () {
|
public async Task <IActionResult> SendEMailForConfirm () {
|
||||||
var user = await _userManager.FindByIdAsync( User.GetUserId() );
|
var user = await _userManager.FindByIdAsync( User.GetUserId() );
|
||||||
|
return View("ConfirmEmailSent");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<bool> SendEMailForConfirm(ApplicationUser user)
|
||||||
|
{
|
||||||
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
||||||
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
|
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
|
||||||
await _emailSender.SendEmailAsync(_siteSettings, _smtpSettings, user.Email, "Confirm your account",
|
await _emailSender.SendEmailAsync(_siteSettings, _smtpSettings, user.Email, "Confirm your account",
|
||||||
"Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>");
|
"Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>");
|
||||||
return View("ConfirmEmailSent");
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// POST: /Account/LogOff
|
// POST: /Account/LogOff
|
||||||
|
|
|
||||||
|
|
@ -774,4 +774,12 @@ Valid caracters are: underscore '_', '-', 'a' - 'z', 'A' - 'Z', '0' - '9', th
|
||||||
<data name="EmailSentForConfirm">
|
<data name="EmailSentForConfirm">
|
||||||
<value>An email has been sent to confirm your addresse.</value>
|
<value>An email has been sent to confirm your addresse.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ConfirmYourAccountTitle"><value>Please, confirm your e-mail</value></data>
|
||||||
|
<data name="ConfirmYourAccountBody"><value>You successfully created your {0} account,
|
||||||
|
but your e-mail address is not yet confirmed.
|
||||||
|
Please, in order to validate it, follow this link <{1}>.
|
||||||
|
|
||||||
|
Thanks.
|
||||||
|
--
|
||||||
|
{0} - {2} <https://{3}></value>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -449,5 +449,11 @@
|
||||||
<data name="PasswordConfirm"><value>Confirmation du mot de passe</value></data>
|
<data name="PasswordConfirm"><value>Confirmation du mot de passe</value></data>
|
||||||
<data name="ErrorSendingEmailForConfirm"><value>L'envoi de de courrier pour confirmation de l'adresse e-mail a échoué.</value></data>
|
<data name="ErrorSendingEmailForConfirm"><value>L'envoi de de courrier pour confirmation de l'adresse e-mail a échoué.</value></data>
|
||||||
<data name="EmailSentForConfirm"><value>Un courrier a été envoyé pour confirmation de l'adresse e-mail .</value></data>
|
<data name="EmailSentForConfirm"><value>Un courrier a été envoyé pour confirmation de l'adresse e-mail .</value></data>
|
||||||
|
<data name="ConfirmYourAccountTitle"><value>S'il vous plait, confirmez votre addresse e-mail</value></data>
|
||||||
|
<data name="ConfirmYourAccountBody"><value>Vous avez créé avec succès votre compte {0},
|
||||||
|
mais votre adresse e-mail reste à confirmer.
|
||||||
|
Pour ce faire, suivez le lien suivant : <{1}>.
|
||||||
|
|
||||||
|
--
|
||||||
|
{0} - {2} <https://{3}></value></data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue