Development #9526
extend user creation API to be able to send a welcome mail
100%
Description
(probably with an activation URL that would ask the user for a password) (this is from #9496)
Fichiers
Révisions associées
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
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0001-make-ctx-optional-in-send_registration_mail-9526.patch 0001-make-ctx-optional-in-send_registration_mail-9526.patch ajouté
- Fichier 0002-send-registration-mails-thourgh-user-creation-API-fi.patch 0002-send-registration-mails-thourgh-user-creation-API-fi.patch ajouté
- Echéance mis à 03 février 2016
- Patch proposed changé de Non à Oui
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.
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0002-send-registration-mails-thourgh-user-creation-API-fi.patch 0002-send-registration-mails-thourgh-user-creation-API-fi.patch ajouté
On fpeters suggestion, condition to send the mail is now send_registration_email and validated_data.get('email')
.
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.
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0002-send-registration-mails-thourgh-user-creation-API-fi.patch 0002-send-registration-mails-thourgh-user-creation-API-fi.patch ajouté
- import logging
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
Appliqué par commit authentic2|8e51c4510cefcfefde0cc02c3c761a4e4c89344e.
Mis à jour par Benjamin Dauvergne il y a environ 8 ans
- Statut changé de Résolu (à déployer) à Solution déployée
Mis à jour par Benjamin Dauvergne il y a plus de 6 ans
- Statut changé de Solution déployée à Fermé
make ctx optional in send_registration_mail() (#9526)