Skip to content

Commit

Permalink
0.3.0 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel authored Jun 17, 2024
2 parents 80fa6b6 + 001f260 commit 0ef5abb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 57 deletions.
55 changes: 3 additions & 52 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,12 @@
# Changelog

## [0.1.4a7](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.1.4a7) (2023-06-30)
## [0.2.1a1](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.2.1a1) (2024-04-10)

[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.1.4a6...0.1.4a7)
[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.2.0...0.2.1a1)

**Merged pull requests:**

- Remove deprecated config reference [\#26](https://github.com/NeonGeckoCom/neon_email_proxy/pull/26) ([NeonDaniel](https://github.com/NeonDaniel))

## [0.1.4a6](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.1.4a6) (2023-06-30)

[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.1.4a5...0.1.4a6)

**Merged pull requests:**

- Update Docker config handling and prep stable release [\#25](https://github.com/NeonGeckoCom/neon_email_proxy/pull/25) ([NeonDaniel](https://github.com/NeonDaniel))

## [0.1.4a5](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.1.4a5) (2023-05-12)

[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.1.4a4...0.1.4a5)

**Merged pull requests:**

- Handle exceptions around legacy configuration handling [\#24](https://github.com/NeonGeckoCom/neon_email_proxy/pull/24) ([NeonDaniel](https://github.com/NeonDaniel))

## [0.1.4a4](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.1.4a4) (2023-05-01)

[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.1.4a3...0.1.4a4)

**Merged pull requests:**

- Update log init and docker deps [\#23](https://github.com/NeonGeckoCom/neon_email_proxy/pull/23) ([NeonDaniel](https://github.com/NeonDaniel))

## [0.1.4a3](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.1.4a3) (2023-04-28)

[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.1.4a2...0.1.4a3)

**Merged pull requests:**

- Update Docker and docs [\#22](https://github.com/NeonGeckoCom/neon_email_proxy/pull/22) ([NeonDaniel](https://github.com/NeonDaniel))

## [0.1.4a2](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.1.4a2) (2023-04-21)

[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.1.4a1...0.1.4a2)

**Merged pull requests:**

- Update configuration handling [\#21](https://github.com/NeonGeckoCom/neon_email_proxy/pull/21) ([NeonDaniel](https://github.com/NeonDaniel))

## [0.1.4a1](https://github.com/NeonGeckoCom/neon_email_proxy/tree/0.1.4a1) (2023-04-21)

[Full Changelog](https://github.com/NeonGeckoCom/neon_email_proxy/compare/0.1.3...0.1.4a1)

**Merged pull requests:**

- Update GitHub automation [\#20](https://github.com/NeonGeckoCom/neon_email_proxy/pull/20) ([NeonDaniel](https://github.com/NeonDaniel))
- Attachment Handling Fix [\#18](https://github.com/NeonGeckoCom/neon_email_proxy/pull/18) ([NeonDaniel](https://github.com/NeonDaniel))
- Add configurable filtering to email send requests [\#28](https://github.com/NeonGeckoCom/neon_email_proxy/pull/28) ([NeonDaniel](https://github.com/NeonDaniel))



Expand Down
22 changes: 18 additions & 4 deletions neon_email_proxy/email_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import pika.channel

from typing import Optional
from ovos_config import Configuration
from ovos_utils.log import LOG
from neon_mq_connector.connector import MQConnector
from neon_mq_connector.utils.network_utils import b64_to_dict, dict_to_b64
Expand All @@ -48,22 +49,35 @@ def __init__(self, config: Optional[dict], service_name: str):
"""
super().__init__(config, service_name)
self.vhost = '/neon_emails'
_config = Configuration().get("neon_email_proxy") or dict()
self._allow_attachments = _config.get("allow_attachments", True)
self._allowed_subjects = (_config.get("allowed_subjects") or
["LLM Conversation", "Neon AI Diagnostics",
"Wolfram|Alpha Source"])

@staticmethod
def handle_send_email(**kwargs):
def handle_send_email(self, **kwargs):
try:
attachments = kwargs.get("attachments")
if attachments:
if attachments and self._allow_attachments:
att_files = write_out_email_attachments(attachments)
else:
if not self._allow_attachments:
LOG.warning("Attachments not allowed in configuration")
att_files = None
if (self._allowed_subjects and kwargs["subject"] not in
self._allowed_subjects):
LOG.warning(f"{kwargs['subject']} not in allowed subjects: "
f"{self._allowed_subjects}")
return {"success": False,
"error": "Invalid subject"}
send_ai_email(kwargs["subject"], kwargs["body"],
kwargs["recipient"], att_files,
kwargs.get("email_config"))
return {"success": True}
except Exception as e:
LOG.error(e)
return {"success": False}
return {"success": False,
"error": str(e)}

def handle_email_request(self,
channel: pika.channel.Channel,
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = "0.2.0"
__version__ = "0.3.0"

0 comments on commit 0ef5abb

Please sign in to comment.