You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) -->
64
68
65
-
This is a module maded it for Parse Server and an easy solution to send emails via SMTP with templates in HTML.
69
+
This is a module made it for Parse Server and an easy solution to send emails via SMTP with templates in HTML, also with the posibility of use a multi language support for your templates.
66
70
67
-
We recomend to use the [Cerberus](https://github.com/TedGoas/Cerberus) for the email templates.
71
+
We recomend you to use the [Cerberus](https://github.com/TedGoas/Cerberus) project for the email templates.
72
+
73
+
( if you know about other templates you can added )
68
74
69
75
### Built With
70
76
@@ -75,8 +81,7 @@ We recomend to use the [Cerberus](https://github.com/TedGoas/Cerberus) for the e
75
81
<!-- GETTING STARTED -->
76
82
## Getting Started
77
83
78
-
This is an example of how you may give instructions on setting up your project locally.
79
-
To get a local copy up and running follow these simple example steps.
84
+
This module is a very simple solution and because of that you can get it up and running in a few minutes.
80
85
81
86
### Installation
82
87
@@ -90,7 +95,7 @@ yarn
90
95
```sh
91
96
yarn add parse-smtp-template
92
97
```
93
-
2. In your Parse Server add the configuration of your email account
98
+
2. In your Parse Server add the configuration of the emailAdapter and fill the requeriments to connect with your email account
94
99
95
100
```
96
101
var api = new ParseServer({
@@ -102,36 +107,45 @@ var api = new ParseServer({
102
107
host: "smtp.mail.com",
103
108
user: "name@domain.com",
104
109
password: "SecurePassword",
105
-
fromAddress: 'app@domain.com',
106
-
107
-
// Optional Parameters
108
-
template: true,
109
-
templatePath: "views/templates/main.html",
110
-
passwordSubject: "A custom password recovery Subject",
111
-
confirmSubject: "A custom email confirmation Subject"
110
+
fromAddress: 'app@domain.com'
112
111
}
113
112
}
114
113
})
115
114
```
116
-
> Now is ready to use it!
115
+
> Now is ready to use!
116
+
117
+
--
118
+
<br />
117
119
118
120
3. (Optional) Config your email template
119
121
120
-
The templates have access to 4 parameters to send
122
+
In this module you can choise to use a simple template (1 template for bouth emails) or multiTemplate (1 template per type of email)
123
+
If you want to use the multi Language mode you need to set up the multi languaje mode.
124
+
---
125
+
126
+
---
127
+
<!-- USAGE EXAMPLES -->
128
+
## Usage
129
+
Use it, it´s very easy 😎😃👌
130
+
131
+
### Simple template
132
+
133
+
This template is used to send bouth email (password recovery and email confirmation)
134
+
135
+
The templates have access to 6 parameters :
121
136
* link
122
-
* username
137
+
* btn
138
+
* body
139
+
* username
123
140
* appName
124
141
* subject
125
142
126
-
To use it you only need to write ${parameter} to use it on the email
143
+
To use it you only need to write `${parameter}`on the template
127
144
128
145
**IMPORTANT** -- **All the HTML file need to use only double quotes to avoid problems**
129
-
130
-
<!-- USAGE EXAMPLES -->
131
-
## Usage
132
-
133
-
To use a custome template is necessary to select the correct file.
134
-
In this example we are gonna use `template.html``
146
+
---
147
+
If you want a custome template is necessary to select the correct file.
148
+
In this example we are gonna use `template.html`
135
149
136
150
index.js
137
151
```
@@ -140,11 +154,32 @@ emailAdapter: {
140
154
options: {
141
155
...
142
156
template: true,
143
-
templatePath: "views/templates/template.html"
157
+
templatePath: "views/templates/template.html",
158
+
159
+
// Custome options to your emails
160
+
// You can add more options if you need
161
+
passwordOptions: {
162
+
subject: "Password recovery",
163
+
body: "Custome pasword recovery email body",
164
+
btn: "Recover your password"
165
+
/* --EXTRA PARAMETERS--
166
+
others: {
167
+
extraParameter
168
+
}
169
+
*/
170
+
},
171
+
confirmOptions: {
172
+
subject: "E-mail confirmation",
173
+
body: "Custome email confirmation body",
174
+
btn: "confirm your email"
175
+
},
144
176
}
145
177
}
146
178
147
179
```
180
+
> To use the extra parameters please use `${options.extraParameter}`
181
+
182
+
148
183
directory
149
184
```
150
185
project
@@ -174,8 +209,130 @@ project
174
209
</tr>
175
210
...
176
211
```
177
-
> You can look up the template is by default in the templates folder to get a better understanding
212
+
> You can look up the template by default to get a better understanding
213
+
214
+
--
215
+
### Multi template
216
+
217
+
This option is a better way to customize your emails because you are able to use a different template per type of email.
218
+
219
+
This template have access to 4 parameters:
220
+
* user _(all the info of the _User object)_
221
+
* link
222
+
* appName
223
+
* options
224
+
225
+
The __options__ parameter needs to have _subject, body_ and _btn_ like minimun
0 commit comments