Merge pull request #526 from strapi/doc/email_variables

Add email template documentation
This commit is contained in:
Jim LAURIE 2018-01-29 09:10:33 +01:00 committed by GitHub
commit 0b07b8c648
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 5 deletions

View File

@ -156,3 +156,7 @@ $.ajax({
}
});
```
## Email templates
[See the documentation on GitHub](https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-users-permissions/docs/email-templates.md)

View File

@ -110,7 +110,7 @@ class PopUpForm extends React.Component { // eslint-disable-line react/prefer-st
validations={{}}
value={get(this.props.values, 'enabled', this.state.enabled)}
/>
{form.length > 1 && <div className={styles.separator} /> }
{map(tail(form), (value, key) => (
@ -173,7 +173,7 @@ class PopUpForm extends React.Component { // eslint-disable-line react/prefer-st
label={`users-permissions.PopUpForm.Email.${value}.label`}
name={`${dataToEdit}.${value}`}
inputDescription={includes(value, 'object') ? 'users-permissions.PopUpForm.Email.email_templates.inputDescription' : ''}
linkContent={includes(value, 'object') ? { link: 'https://strapi.io/documentation/plugin-development/ui-components.html', description: 'users-permissions.PopUpForm.Email.link.documentation' } : {}}
linkContent={includes(value, 'object') ? { link: 'https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-users-permissions/docs/email-templates.md', description: 'users-permissions.PopUpForm.Email.link.documentation' } : {}}
onChange={this.props.onChange}
placeholder={`users-permissions.PopUpForm.Email.${this.props.dataToEdit}.${value}.placeholder`}
type={includes(value, 'object') ? 'text' : 'textarea'}

View File

@ -1,3 +0,0 @@
# Templating emails
Documentation in progress....

View File

@ -0,0 +1,13 @@
# Templating emails
By default, this plugin comes with only one template (reset password) for the moment. More templates will come later. The templates use Lodash' template() method to populate the variables.
### Reset Password
- `USER` (object)
- `username`
- `email`
- ...and every other fields that you added manually in the model.
- `TOKEN` corresponds to the token generated to be able to reset the password.
- `URL` is the link where the user will be redirected after clicking on it in the email.