Skip to content
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

Fix bug when no name was configured #15

Merged
merged 1 commit into from
Sep 6, 2016
Merged

Conversation

maryum375
Copy link
Contributor

The mail contained "Hello undefined"

The mail contained "Hello undefined"
@eladnava
Copy link
Owner

eladnava commented Sep 6, 2016

Thanks so much for your contribution @maryum375! 😄

LGTM. Next time, please format your code according to the project's code style. 👍

@eladnava eladnava merged commit 11e996b into eladnava:master Sep 6, 2016
eladnava added a commit that referenced this pull request Sep 6, 2016
Refactor code from #15. Thanks to @maryum375 for the PR.
@eladnava
Copy link
Owner

eladnava commented Sep 6, 2016

Released v1.0.26 @maryum375

@@ -113,7 +113,11 @@ Mailgen.prototype.parseParams = function (params) {

// Use `greeting` and `name` for title if not set
if (!body.title) {
body.title = body.greeting + ' ' + body.name + ',';
body.title = body.greeting;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't the same thing happen with body.greeting being undefined?

Copy link
Owner

@eladnava eladnava Sep 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lirantal nope, there is already a check for that here:

body.greeting = body.greeting || 'Hi';

It falls back to 'Hi' if undefined.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh cool, didn't open the entire file to look it up.
Good job.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lirantal thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants