Update email info copy

This commit is contained in:
Berkeley Martinez
2016-06-02 13:01:32 -07:00
parent ff4dfb09da
commit 564f4c1180
4 changed files with 53 additions and 70 deletions

View File

@@ -366,27 +366,19 @@ module.exports = function(User) {
'user-email-verify.ejs'
)
};
return this.verify(mailOptions).then(
(data) => {
if (data) {
return Promise.resolve(
dedent`
Your email has been updated successfully, Please
follow the link we sent you, to confirm.
`);
}
return Promise.reject(
'Oops, something went wrong, please try again later'
);
},
(error) => {
debug(error);
return Promise.reject(
'Oops, something went wrong, please try again later'
);
}
return this.verify(mailOptions);
})
.map(() => dedent`
Please check your email.
We sent you a link that you can click to verify your email address.
`)
.catch(error => {
debug(error);
return Observable.throw(
'Oops, something went wrong, please try again later'
);
}).toPromise();
})
.toPromise();
});
};

View File

@@ -1,5 +1,3 @@
import dedent from 'dedent';
export function ifNoUserRedirectTo(url, message, type = 'errors') {
return function(req, res, next) {
const { path } = req;
@@ -38,15 +36,10 @@ export function flashIfNotVerified(req, res, next) {
}
const email = req.user.email;
const emailVerified = req.user.emailVerified;
if (!email) {
req.flash('info', { msg:
dedent `Please update your email address when you get a moment in
your <a href="\settings"> Settings Page.</a>`
});
} else if (!emailVerified) {
req.flash('info', { msg:
dedent `We have your email address with us, but its not yet verified.
Please follow the link we sent you, when you get a moment.`
if (!email || !emailVerified) {
req.flash('info', {
msg: 'Please verify your email address ' +
'<a href="/update-email">here.</a>'
});
}
return next();

View File

@@ -1,24 +1,23 @@
<h2>
Greetings from San Francisco!
</h2>
<p>
Thank you for joining our community.
</p>
<p>
Please verify your email by following the link below:
</p>
<p>
<a href="<%= verifyHref %>"><%= verifyHref %></a>
</p>
<p>
Feel free to email us at this address if you have any questions about Free Code Camp.
</p>
<p>
And if you have a moment, check out our blog: https://medium.freecodecamp.com.
</p>
<p>
Good luck with the challenges!
</p>
<p>
- the Free Code Camp Team.
</p>
Greetings from San Francisco!
<br>
<br>
Thank you for joining our community.
<br>
<br>
Please verify your email by following the link below:
<br>
<br>
<a href="<%= verifyHref %>"><%= verifyHref %></a>
<br>
<br>
Feel free to email us at this address if you have any questions about Free Code Camp.
<br>
<br>
And if you have a moment, check out our blog: https://medium.freecodecamp.com.
<br>
<br>
Good luck with the challenges!
<br>
<br>
<br>
- the Free Code Camp Team.

View File

@@ -1,15 +1,14 @@
<h3>
Thank you, for updating you contact details.
</h3>
<p>
Please verify your email by following the link below:
</p>
<p>
<a href="<%= verifyHref %>"><%= verifyHref %></a>
</p>
<p>
Feel free to email us at this address if you have any questions about Free Code Camp.
</p>
<p>
- the Free Code Camp Team.
</p>
Thank you, for updating you contact details.
<br>
<br>
Please verify your email by following the link below:
<br>
<br>
<a href="<%= verifyHref %>"><%= verifyHref %></a>
<br>
<br>
Feel free to email us at this address if you have any questions about Free Code Camp.
<br>
<br>
<br>
- the Free Code Camp Team.