Draft: chore: add smtp-credentials model
Add a api::decidim.smtp-credential model draft for frontend beeing developped. Here the behaviour:
- If NO smtp credentials are found for an instance, it is using the voca (default smtp)
- If you create a SMTP credential, it will populate a confirmation_token
- On creation/update, current user receive an email with a confirmation link (pointing to frontend)
- Once the user click on confirmation, the frontend send a POST request to
/api/smtp-credentials/confirm/:instanceUUID/:confirmationToken
. WhereinstanceUUID
is the uuid of the instance, andconfirmationToken
is the confirmation token passed to the frontend. - If no errors happens, the SMTP credential update the fields in the decidim and set the
synced_at
value to current date.
How to go back to default?
- delete the smtp-credential
How to update the smtp credential
- Do a query to update
- the confirmation_token change, and a new email is sent. The
synced_at
go to null - Rest of the flow is identical to creation.