Projet

Général

Profil

Development #9526

extend user creation API to be able to send a welcome mail

Ajouté par Frédéric Péters il y a plus de 8 ans. Mis à jour il y a plus de 6 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
06 janvier 2016
Echéance:
03 février 2016
% réalisé:

100%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

(probably with an activation URL that would ask the user for a password) (this is from #9496)


Fichiers

Révisions associées

Révision 91cc8582 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 8 ans

make ctx optional in send_registration_mail() (#9526)

Révision 8e51c451 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 8 ans

send registration mails thourgh user creation API (fixes #9526)

To send a mail you must add the send_registration_email=True to your JSON
document. If you want the user to land on another page than authentic homepage,
you can add send_registration_email_next_url key with a custom URL.

Historique

#2

Mis à jour par Benjamin Dauvergne il y a plus de 8 ans

API is extended with two new special keys:

{ 'send_registration_email': True/False, [ 'send_registration_email_next_url': 'https://combo/welcome/'] }

the template used is the same as for the /api/register/ API, i.e. authentic2/activation_email_{subject.txt,body.txt,body.html}.

It's best used with settings.A2_EMAIL_IS_UNIQUE=True, as without this setting login is not automatic: user will have the choice between creating a new user or login with an existing one after clicking on the registration URL.

#3

Mis à jour par Benjamin Dauvergne il y a plus de 8 ans

On fpeters suggestion, condition to send the mail is now send_registration_email and validated_data.get('email').

#4

Mis à jour par Frédéric Péters il y a plus de 8 ans

Btw I notice now that you do import logging but do not use it.

#6

Mis à jour par Benjamin Dauvergne il y a plus de 8 ans

  • Statut changé de Nouveau à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#7

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

  • Statut changé de Résolu (à déployer) à Solution déployée
#8

Mis à jour par Benjamin Dauvergne il y a plus de 6 ans

  • Statut changé de Solution déployée à Fermé

Formats disponibles : Atom PDF