-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SendMail via Parse.Cloud.sendMail() #7089
Labels
type:feature
New feature or improvement of existing feature
Comments
You can already do this easily like this: const { AppCache } = require('parse-server/lib/cache');
Parse.Cloud.afterLogin(async request => {
const MailgunAdapter = AppCache.get('INSERT_YOUR_APPID_HERE').userController.adapter;
const { object: user } = request;
const email = user.get('email');
return MailgunAdapter.send({
templateName: 'newLoginEmail',
recipient: email,
variables: { username: email, date: Date().toString() }
});
}
}); |
Thanks for suggesting. It may be just a simple PR, but it could be a nice convenience method to simply call |
PR already on the way if you’re keen to review my code again @mtrezza ;) |
Closed by #7096. |
mtrezza
added
type:feature
New feature or improvement of existing feature
and removed
type:improvement
labels
Dec 6, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New Feature / Enhancement Checklist
Current Limitation
I currently use a Mailgun emailAdapter on my Parse Servers. Yet in my cloud code whenever I want to send email, I have to call:
I could be doing this wrong, idk.
Feature / Enhancement Description
It would be nice to have:
Parse.Cloud.sendEmail(data)
and it inherit the sendEmail function from the emailAdapter. It would also support newer developers as they don't have to read their mail providers docs to learn how to send email, as the adapter handles it for them. If no email adapter is specified, throw an error.The text was updated successfully, but these errors were encountered: