Skip to content

Commit 1ed3445

Browse files
committed
Merge remote-tracking branch 'upstream/main' into patch-1
2 parents 73c0972 + c9cde83 commit 1ed3445

File tree

8 files changed

+997
-795
lines changed

8 files changed

+997
-795
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: "\U0001F41B Report an issue"
3+
about: A feature is not working as expected.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
### New Issue Checklist
11+
<!--
12+
Please check the following boxes [x] before submitting your issue.
13+
Click the "Preview" tab for better readability.
14+
Thanks for contributing!
15+
-->
16+
17+
- [ ] I am not disclosing a [vulnerability](https://github.com/mtrezza/parse-server-api-mail-adapter/security/policy).
18+
- [ ] I am not just asking a [question](https://github.com/mtrezza/parse-server-api-mail-adapter#need-help).
19+
- [ ] I have searched through [existing issues](https://github.com/mtrezza/parse-server-api-mail-adapter/issues?q=is%3Aissue).
20+
- [ ] I can reproduce the issue with the [latest version](https://github.com/mtrezza/parse-server-api-mail-adapter/releases). <!-- We don't investigate issues for outdated releases. -->
21+
22+
### Issue Description
23+
<!-- What is the specific issue? -->
24+
25+
### Steps to reproduce
26+
<!-- How can someone else reproduce the issue? -->
27+
28+
### Actual Outcome
29+
<!-- What outcome, for example query result, did you get? -->
30+
31+
### Expected Outcome
32+
<!-- What outcome, for example query result, did you expect? -->
33+
34+
### Failing Test Case / Pull Request
35+
<!--
36+
Add a reference if you submitted a PR.
37+
A PR with a failing test case helps us to analyze the issue.
38+
A PR with a test case and a fix helps us to close this issue.
39+
-->
40+
41+
### Environment
42+
<!-- Be specific with versions, don't use "latest" or semver ranges like "~x.y.z" or "^x.y.z". -->
43+
44+
- API Mail Adapter version: `FILL_THIS_OUT`
45+
- Parse Server version: `FILL_THIS_OUT`
46+
47+
### Logs
48+
<!-- Include relevant logs here. Turn on additional logging by configuring VERBOSE=1 in your environment. -->
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: "\U0001F4A1 Request a feature"
3+
about: Suggest new functionality or an enhancement of existing functionality.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
### New Feature / Enhancement Checklist
11+
<!--
12+
Please check the following boxes [x] before submitting your issue.
13+
Click the "Preview" tab for better readability.
14+
Thanks for contributing!
15+
-->
16+
17+
- [ ] I am not disclosing a [vulnerability](https://github.com/mtrezza/parse-server-api-mail-adapter/security/policy).
18+
- [ ] I am not just asking a [question](https://github.com/mtrezza/parse-server-api-mail-adapter#need-help).
19+
- [ ] I have searched through [existing issues](https://github.com/mtrezza/parse-server-api-mail-adapter/issues?q=is%3Aissue).
20+
21+
### Current Limitation
22+
<!-- Which current limitation is the feature or enhancement addressing? -->
23+
24+
### Feature / Enhancement Description
25+
<!-- What is the concept of the functionality and how should it be implemented? -->
26+
27+
### Example Use Case
28+
<!-- What is an example use case in steps (1. / 2. / 3. / etc.) that describes the functionality? -->
29+
30+
### Alternatives / Workarounds
31+
<!-- Which alternatives or workarounds exist currently? -->
32+
33+
### 3rd Party References
34+
<!-- Have you seen a similar functionality provided somewhere else? -->

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 🙋🏽‍♀️ Getting help with code
4+
url: https://stackoverflow.com/questions/tagged/parse-platform
5+
about: Get help with code-level questions on Stack Overflow.
6+
- name: 🙋 Getting general help
7+
url: https://community.parseplatform.org
8+
about: Get help with other questions on our Community Forum.

.github/pull_request_template.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
### New Pull Request Checklist
2+
<!--
3+
Please check the following boxes [x] before submitting your issue.
4+
Click the "Preview" tab for better readability.
5+
Thanks for contributing!
6+
-->
7+
8+
- [ ] I am not disclosing a [vulnerability](https://github.com/mtrezza/parse-server-api-mail-adapter/security/policy).
9+
- [ ] I am creating this PR in reference to an [issue](https://github.com/mtrezza/parse-server-api-mail-adapter/issues?q=is%3Aissue).
10+
11+
### Issue Description
12+
<!-- Add a brief description of the issue this PR solves. -->
13+
14+
Related issue: FILL_THIS_OUT
15+
16+
### Approach
17+
<!-- Add a description of the approach in this PR. -->
18+
19+
### TODOs before merging
20+
<!--
21+
Add TODOs that need to be completed before merging this PR.
22+
Delete suggested TODOs that do not apply to this PR.
23+
-->
24+
25+
- [ ] Add test cases
26+
- [ ] Add entry to changelog
27+
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)

demo/index.js

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Demo script to send an email using the Mailgun API.
44
* ==============================================================
55
* Instructions:
6-
*
6+
*
77
* 1. Create a file `mailgun.json` in the root directory with the
88
* following keys to configure the test script:
99
* ```
@@ -15,7 +15,7 @@
1515
* recipient: "xxx", // The email recipient.
1616
* }
1717
* ```
18-
*
18+
*
1919
* 2. Run this script with `node ./demo` to send the email.
2020
* ==============================================================
2121
*/
@@ -26,55 +26,54 @@ const mailgun = require('mailgun.js');
2626
const path = require('path');
2727

2828
const {
29-
key,
30-
domain,
31-
host,
32-
sender,
33-
recipient
29+
key,
30+
domain,
31+
sender,
32+
recipient
3433
} = require('./mailgun.json');
3534

3635
const mailgunClient = mailgun.client({ username: 'api', key: key });
3736
const filePath = (file) => path.resolve(__dirname, '../spec/templates/', file);
3837
const config = {
39-
sender: sender,
40-
templates: {
41-
passwordResetEmail: {
42-
subjectPath: filePath('password_reset_email_subject.txt'),
43-
textPath: filePath('password_reset_email.txt'),
44-
htmlPath: filePath('password_reset_email.html')
45-
},
46-
verificationEmail: {
47-
subjectPath: filePath('verification_email_subject.txt'),
48-
textPath: filePath('verification_email.txt'),
49-
htmlPath: filePath('verification_email.html')
50-
},
51-
customEmail: {
52-
subjectPath: filePath('custom_email_subject.txt'),
53-
textPath: filePath('custom_email.txt'),
54-
htmlPath: filePath('custom_email.html'),
55-
placeholders: {
56-
username: "DefaultUser",
57-
appName: "DefaultApp"
58-
},
59-
extra: {
60-
replyTo: '[email protected]'
61-
}
62-
}
38+
sender: sender,
39+
templates: {
40+
passwordResetEmail: {
41+
subjectPath: filePath('password_reset_email_subject.txt'),
42+
textPath: filePath('password_reset_email.txt'),
43+
htmlPath: filePath('password_reset_email.html')
6344
},
64-
apiCallback: async ({ payload }) => {
65-
const mailgunPayload = ApiPayloadConverter.mailgun(payload);
66-
await mailgunClient.messages.create(domain, mailgunPayload);
45+
verificationEmail: {
46+
subjectPath: filePath('verification_email_subject.txt'),
47+
textPath: filePath('verification_email.txt'),
48+
htmlPath: filePath('verification_email.html')
49+
},
50+
customEmail: {
51+
subjectPath: filePath('custom_email_subject.txt'),
52+
textPath: filePath('custom_email.txt'),
53+
htmlPath: filePath('custom_email.html'),
54+
placeholders: {
55+
username: "DefaultUser",
56+
appName: "DefaultApp"
57+
},
58+
extra: {
59+
replyTo: '[email protected]'
60+
}
6761
}
62+
},
63+
apiCallback: async ({ payload }) => {
64+
const mailgunPayload = ApiPayloadConverter.mailgun(payload);
65+
await mailgunClient.messages.create(domain, mailgunPayload);
66+
}
6867
};
6968

7069
const adapter = new ApiMailAdapter(config);
7170

7271
adapter.sendMail({
73-
templateName: 'customEmail',
74-
recipient: recipient,
75-
placeholders: {
76-
appName: "ExampleApp",
77-
username: "ExampleUser"
78-
},
79-
direct: true
80-
});
72+
templateName: 'customEmail',
73+
recipient: recipient,
74+
placeholders: {
75+
appName: "ExampleApp",
76+
username: "ExampleUser"
77+
},
78+
direct: true
79+
});

0 commit comments

Comments
 (0)