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

Feature/configure email notifications #10

Merged

Conversation

jblance
Copy link
Contributor

@jblance jblance commented Feb 12, 2018

My initial attempt to implement email notification configuring (for issue #8 )

Note: authenticated SMTP is not implemented
Note2: no spec tests as I have figured them out yet....

@TraGicCode
Copy link
Owner

Hey there,

Great to see you opening issues and pull requests. Hopefully we can knock some of these out.

I will take a look at this in the morning and provide any feedback that I have.

@TraGicCode TraGicCode self-requested a review February 14, 2018 03:42
Copy link
Owner

@TraGicCode TraGicCode left a comment

Choose a reason for hiding this comment

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

Looks good so far. I've requested some minor changes. Sorry for taking to long to review this. I have been really busy on my end so i've had to push this down on my list of things to do.

String $smtp_sender_displayname = $wsusserver::params::smtp_sender_displayname,
String $smtp_sender_emailaddress = $wsusserver::params::smtp_sender_emailaddress,
String $email_language = $wsusserver::params::email_language,

Copy link
Owner

Choose a reason for hiding this comment

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

Remove this extra newline.

Copy link
Owner

Choose a reason for hiding this comment

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

Still waiting on you to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -19,6 +19,20 @@
Boolean $synchronize_automatically = $wsusserver::params::synchronize_automatically,
String $synchronize_time_of_day = $wsusserver::params::synchronize_time_of_day,
Integer $number_of_synchronizations_per_day = $wsusserver::params::number_of_synchronizations_per_day,
Boolean $send_sync_notification = $wsusserver::params::send_sync_notification,
Copy link
Owner

Choose a reason for hiding this comment

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

Can you document these parameters in the README.md ( https://github.com/TraGicCode/tragiccode-wsusserver/blob/master/README.md#wsusserver-1 ) like the other parameters that make up the public interface to this class?

Copy link
Owner

Choose a reason for hiding this comment

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

Still waiting on you to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@TraGicCode
Copy link
Owner

Also if you can please squash you commits to clean up some of the noise with the WIP and oops commits.

@jblance
Copy link
Contributor Author

jblance commented Feb 21, 2018

Hi

I made review changes
I've tried to squash the commits, I cant seem to do it except to a new branch? Do you know how, or should I just PR the new branch instead?

Regards

@TraGicCode
Copy link
Owner

This should handle the squash for you.

git checkout feature/configure-emailnotifications
git reset $(git merge-base master feature/configure-emailnotifications)
git add -A
git commit -m "Added email feature or something like this"
git push <your_remote_name> HEAD --force

@jblance jblance force-pushed the feature/configure-emailnotifications branch from 47f03e4 to b98dd0b Compare February 22, 2018 01:36
@jblance
Copy link
Contributor Author

jblance commented Feb 22, 2018

Thanks for the squash help
Done now - hopefully nothing got undone with my messing around..

@TraGicCode
Copy link
Owner

@jblance The squash looks good to me. Can you fix the above changes i requested? Once done simply type "Done." in each comment.

\$wsusEmailNotificationConfiguration = (Get-WsusServer).GetEmailNotificationConfiguration()
\$wsusEmailNotificationConfiguration.SendSyncNotification = \$${send_sync_notification}
\$wsusEmailNotificationConfiguration.Save()
return 'SendSyncNotification setting updated'
Copy link
Owner

Choose a reason for hiding this comment

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

Can we remove this? Doubt it's needed.

Copy link
Contributor Author

@jblance jblance Feb 24, 2018

Choose a reason for hiding this comment

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

Remove which bit?

This sets the "Send email on sync update", i.e turning the feature on or off
I think this is needed, unless I'm missing something

Copy link
Owner

Choose a reason for hiding this comment

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

I'm referring to the return 'SendSyncNotification setting updated' piece since it is not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh OK - I've removed them

I did quite like that it output that info when running puppet agent -tv manually

\$wsusEmailNotificationConfiguration = (Get-WsusServer).GetEmailNotificationConfiguration()
\$wsusEmailNotificationConfiguration.SendStatusNotification = \$${send_status_notification}
\$wsusEmailNotificationConfiguration.Save()
return 'SendStatusNotification setting updated'
Copy link
Owner

Choose a reason for hiding this comment

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

Same here. See above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@TraGicCode
Copy link
Owner

@jblance Here are some more minor changes. I will run setup some beaker tests and perform some acceptance testing and let you know of any issues i run into.

@TraGicCode
Copy link
Owner

@jblance Thank you for your contribution. Hope to see more again soon!

@TraGicCode TraGicCode merged commit 402c638 into TraGicCode:master Mar 18, 2018
@jblance jblance deleted the feature/configure-emailnotifications branch March 27, 2018 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants