Skip to content

Commit fb78ecc

Browse files
Fix syntax errors in mail adapter configuration example & use current mailgun adapter setup
1 parent ce10b72 commit fb78ecc

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,13 @@ An example configuration to add the API Mail Adapter to Parse Server could look
5555
5656
```js
5757
// Declare a mail client
58-
const mailgun = require('mailgun.js');
59-
const mailgunClient = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY });
58+
const formData = require("form-data");
59+
const Mailgun = require("mailgun.js");
60+
const mailgun = new Mailgun(formData);
61+
const mailgunClient = mailgun.client({
62+
username: "api",
63+
key: process.env.MAILGUN_API_KEY,
64+
});
6065
const mailgunDomain = process.env.MAILGUN_DOMAIN;
6166
6267
// Configure Parse Server
@@ -73,24 +78,24 @@ const server = new ParseServer({
7378
// The template used by Parse Server to send an email for password
7479
// reset; this is a reserved template name.
7580
passwordResetEmail: {
76-
subjectPath: './files/password_reset_email_subject.txt'),
77-
textPath: './files/password_reset_email.txt'),
78-
htmlPath: './files/password_reset_email.html')
81+
subjectPath: './files/password_reset_email_subject.txt',
82+
textPath: './files/password_reset_email.txt',
83+
htmlPath: './files/password_reset_email.html'
7984
},
8085
// The template used by Parse Server to send an email for email
8186
// address verification; this is a reserved template name.
8287
verificationEmail: {
83-
subjectPath: './files/verification_email_subject.txt'),
84-
textPath: './files/verification_email.txt'),
85-
htmlPath: './files/verification_email.html')
88+
subjectPath: './files/verification_email_subject.txt',
89+
textPath: './files/verification_email.txt',
90+
htmlPath: './files/verification_email.html'
8691
},
8792
// A custom email template that can be used when sending emails
8893
// from Cloud Code; the template name can be choosen freely; it
8994
// is possible to add various custom templates.
9095
customEmail: {
91-
subjectPath: './files/custom_email_subject.txt'),
92-
textPath: './files/custom_email.txt'),
93-
htmlPath: './files/custom_email.html'),
96+
subjectPath: './files/custom_email_subject.txt',
97+
textPath: './files/custom_email.txt',
98+
htmlPath: './files/custom_email.html',
9499
// Placeholders are filled into the template file contents.
95100
// For example, the placeholder `{{appName}}` in the email
96101
// will be replaced the value defined here.
@@ -140,9 +145,9 @@ Emails are composed using templates. A template defines the paths to its content
140145
```js
141146
templates: {
142147
exampleTemplate: {
143-
subjectPath: './files/custom_email_subject.txt'),
144-
textPath: './files/custom_email.txt'),
145-
htmlPath: './files/custom_email.html'),
148+
subjectPath: './files/custom_email_subject.txt',
149+
textPath: './files/custom_email.txt',
150+
htmlPath: './files/custom_email.html',
146151
}
147152
},
148153
```
@@ -226,4 +231,4 @@ Parse.Cloud.sendEmail({
226231
# Need help?
227232

228233
- Ask on StackOverflow using the [parse-server](https://stackoverflow.com/questions/tagged/parse-server) tag.
229-
- Search through existing [issues](https://github.com/mtrezza/parse-server-api-mail-adapter/issues) or open a new issue.
234+
- Search through existing [issues](https://github.com/mtrezza/parse-server-api-mail-adapter/issues) or open a new issue.

0 commit comments

Comments
 (0)