So I finally have my own parse-server running locally and on heroku. Currently I’m working on incorporating the parse-server-api-mail-adapter and got it mostly working with mailgun.
When requesting for a reset password email, it works fine, I receive the email.
However, my problem is I don’t know why verificationEmail doesn’t seem to work. MailGun logs doesn’t show that it received the call. My swift app says it successfully called the function.
But I can’t seem to see any errors on the parse-server and nothing shows up on parse-server logs.
I have my configuration setup as described in the parse-server-api-mail-adapter readme as such
emailAdapter: {
module: 'parse-server-api-mail-adapter',
options: {
// The email address from which emails are sent.
sender: '[email protected]',
// The email templates.
templates: {
// The template used by Parse Server to send an email for password
// reset; this is a reserved template name.
passwordResetEmail: {
subjectPath: './files/templates/password_reset_email_subject.txt',
textPath: './files/templates/password_reset_email.txt',
htmlPath: './files/templates/password_reset_email.html'
},
// The template used by Parse Server to send an email for email
// address verification; this is a reserved template name.
verificationEmail: {
subjectPath: './files/templates/verification_email_subject.txt',
textPath: './files/templates/verification_email.txt',
htmlPath: './files/templates/verification_email.html'
},
// A custom email template that can be used when sending emails
// from Cloud Code; the template name can be chosen freely; it
// is possible to add various custom templates.
customEmail: {
subjectPath: './files/templates/custom_email_subject.txt',
textPath: './files/templates/custom_email.txt',
htmlPath: './files/templates/custom_email.html',
// Placeholders are filled into the template file contents.
// For example, the placeholder `{{appName}}` in the email
// will be replaced the value defined here.
placeholders: {
appName: "ExampleApp"
},
// Extras to add to the email payload that is accessible in the
// `apiCallback`.
extra: {
replyTo: '[email protected]'
},
// A callback that makes the Parse User accessible and allows
// to return user-customized placeholders that will override
// the default template placeholders. It also makes the user
// locale accessible, if it was returned by the `localeCallback`,
// and the current placeholders that will be augmented.
placeholderCallback: async ({ user, locale, placeholders }) => {
return {
phone: user.get('phone')
};
},
// A callback that makes the Parse User accessible and allows
// to return the locale of the user for template localization.
localeCallback: async (user) => {
return user.get('locale');
}
}
},
// The asynchronous callback that contains the composed email payload to
// be passed on to an 3rd party API and optional meta data. The payload
// may need to be converted specifically for the API; conversion for
// common APIs is conveniently available in the `ApiPayloadConverter`.
// Below is an example for the Mailgun client.
apiCallback: async ({ payload, locale }) => {
const mailgunPayload = ApiPayloadConverter.mailgun(payload);
await mailgunClient.messages.create(mailgunDomain, mailgunPayload);
}
}
}
only difference is i added a subfolder /templates/.
package.json dependencies are:
"dependencies": {
"date-fns": "^2.28.0",
"express": "^4.18.1",
"jimp": "^0.16.1",
"mailgun.js": "^6.0.1",
"mustache": "^4.2.0",
"parse-dashboard": "^4.0.0",
"parse-server": "^5.2.1",
"parse-server-api-mail-adapter": "^2.1.0",
"regenerator-runtime": "^0.13.9",
"uuid": "^8.3.2"
},
any help or leads to where to look would be appreciated.