removed smtp_url as causing failures for sending.
refactored to make it easier to update in future.

- swapped if elif for case statement.
- instead of boolean install or uninstall set action var
  and run the code block in associated case statements.