Parse-server: Reset Password - parse-server

I am trying to implement my own local parse-server with my application. Everything is working fine except for reseting password for users.
I receive the following error
(node:8729) UnhandledPromiseRejectionWarning: Unhandledpromiserejection
(rejection id: 2): Error: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title><h1>Not Found</h1><p>The requested URL was not found on
the server.</p>
<p>If you entered the URL manually please check your spelling and try again.</p>

Do you have the email adapter configured in index.js? As per documentation,
Email verification and password reset
Verifying user email addresses and enabling password reset via email requires an email adapter. As part of the parse-server package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
var server = ParseServer({
...otherOptions,
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Parse App',
// The email adapter
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
},
...otherOptions
});

Related

From attribute inside node mailer message not working always keep sending mail through default account which is used for creating account

let message={
from:email,
to:emails,
text:'Please join the meeting',
subject:`You are Invited for ${meetingName}`,
html:mail
}
Above is my message object the from attribute is not working. I want to send email from logged in user to the user given by him , but node mailer uses the email (my email which is configured at auth) it must use email given in from tag.
const config={
service:'gmail',
auth: {
user:"xx#gmail.com",
pass: ""
},
port:465,
host:'smtp.gmail.com'
}
always uses xx#gmail.com instead of logged in user

Google blocks smtp in react-native

I am having trouble with google smtp for sending emails from my app.
The app works fine in my mobile and I am able to send emails without any issue.
But When I publish the app and people start using it, I get a security email from google telling me that it has blocked a login try.
I have even enabled less secure login.
Is there any other settings I should enable?
Here is my code for sending emails
import RNSmtpMailer from 'react-native-smtp-mailer'
async sendEmail(email: string, htmlBody: string, subject: string) {
try {
var settings = await this.getAppSettings();
if (!settings)
throw "Could not find the smtp settings"
var success = await RNSmtpMailer.sendMail({
mailhost: settings.smtp,
port: settings.port,
ssl: true, // optional. if false, then TLS is enabled. Its true by default in android. In iOS TLS/SSL is determined automatically, and this field doesn't affect anything
username: settings.email,
password: settings.password,
fromName: "NovelManager", // optional
replyTo: undefined, // optional
recipients: email,
bcc: [], // optional
subject: subject,
htmlBody: htmlBody,
attachmentPaths: [], // optional
attachmentNames: [], // required in android, these are renames of original files. in ios filenames will be same as specified in path. In a ios-only application, no need to define it
});
return true;
} catch (error) {
return false;
}
}
and here is the smtp settings
{
smtp: "smtp.gmail.com",
port: "465",
email: "test#gmail.com", // not the real email
password: "test"
}
Ok at last I found a solution, And that is using app password instead of simple password.
I am posting the solution here incase anyone is intressted.

How to send encrypted/TLS emails with NodeJS from localhost using send mail

I want to be able to send emails from my local domain without using gmail or other SMTP servers.
I'm currently using SendMail:
const sendmail = require('sendmail') ({
logger: {
debug: console.log,
info: console.info,
warn: console.warn,
error: console.error
},
dkim: {
privateKey: dkimPrivateKey,
keySelector: 'default'
},
});
sendmail({
from: 'foo#mydomain.com',
to: 'mygmail#gmail.com',
subject: 'test sendmail',
html: 'Mail of test sendmail ',
}, function(err, reply) {
console.log(err && err.stack);
console.dir(reply);
});
and this DOES work, BUT when I receive the email in my Gmail account, and I view the message information, Google is marking this as 'security: No encryption'
From what I understand I need to use TLS to create a 'secure' connection. I already have a certificate and keys from LetsEncrypt and my domain is already using HTTPS. How do I encrypt/use TLS my outgoing emails?
Or is there a better package for this? I've tried using NodeMailer and my emails only get added to a 'queue' and never sent. What is the problem?

Enabling Reset Password and email verification for parse-server hosted locally

I am trying to enable reset password and email verification for my parse-server-example installed locally. I could see we have https://github.com/parse-server-modules/parse-mailgun.
But I am not clear how to use parse-mailgun in parse-server-example, I am completely lost with it.
Can somebody explain or suggest steps to enable it?
Regards
Atul
Create account with MailGun, and get apiKey and Domain from its website.
Copy and Paste below configuration under index.js file of your parse-server-example git folder at your local system.You can get this file under parse-server-example folder directly.
verifyUserEmails: true,
publicServerURL: 'https://yourproject.herokuapp.com/parse',
appName: 'Parse App',
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
fromAddress: 'parse#example.com',
domain: '<domainProvidedFromMailGun>.mailgun.org',
apiKey: 'key-FromMailGun',
}
},
Push it to heroku app git, since I have piloted my parse-server to heroku so below cmd's will be valid.
git add .
git commit -m "mypush commit"
heroku git:remote -a fast-springs-29785
git push heroku master
https://github.com/ParsePlatform/parse-server
Email verification and password reset
Verifying user email addresses and enabling password reset via email requries an email adapter. As part of the parse-server package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
var server = ParseServer({
...otherOptions,
// Enable email verification
verifyUserEmails: true,
// The public URL of your app.
// This will appear in the link that is used to verify email addresses and reset passwords.
// Set the mount path as it is in serverURL
publicServerURL: 'https://example.com/parse',
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Parse App',
// The email adapter
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
}
});
You can also use other email adapters contributed by the community such as parse-server-sendgrid-adapter or parse-server-mandrill-adapter.

Sending email through Appcelerator Cloud API

I was trying to send email through Appcelerator Cloud Service, in my Titanium app. The code I'm using is the standart one, given at the documentation site. But the email is not being sent.
Cloud.Emails.send({
template: 'welcome',
recipients: '*******#gmail.com'
},
function (e) {
if (e.success) {
Titanium.API.info('Email sent successfully.');
} else {
Titanium.API.info('Error:\\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
It give the this error, 'Email template welcome is not found'. I was thinking that template is the message to be sent in email. There is no help on API about this attribute , template. Can anybody explain it to me? I'll be thankful.
Thanx
The error shows that you haven't created an email template on the ACS website yet. The following steps will help you to create email template
Log in to your Appcelerator App Console
click "Manage ACS" under the app you're working on
click the "Email Templates" tab
"Create an Email Template".
also you can setup your SMTP settings as follows which worked for me.
Username: ________#gmail.com
Password: gmail account password
TLS: true/ false (both will work)
SMTP Address: smtp.gmail.com
Port: 587
Domain : www.gmail.com
That error means you haven't created an email template on the ACS website yet. Log in to your Appcelerator App Console, click "Manage ACS" under the app you're working on, then click the "Email Templates" tab, and "Create an Email Template".