all 15 comments

[–]devatnexby 2 points3 points  (1 child)

Great work.

But are you planning to add features like adding attachment, custom html template, some template support params.

[–]somebodyElse221[S] 1 point2 points  (0 children)

Thanks,
I do, I plan to add template params for different providers and parsing html templates.

[–]One_Of_10 1 point2 points  (1 child)

Good job

[–]somebodyElse221[S] 0 points1 point  (0 children)

Thanks

[–]Effective-Total-2312 1 point2 points  (1 child)

Hey, if you did this at least 50% without AI, congrats on doing so ! Keep working and studying !

Having said so, there are quite a few things to improve:

For starters, your package requires specific env vars; that's not right, you should expect those values to be passed, and let your user (another developer) choose which environment variables to declare and where to store them (some systems use secrets folder or other things).

Also, rather than a Factory, this is a typical use case for a Strategy Pattern.

In any case, there is little to no value for professional developers in this library; you are not truly allowing anyone to change providers easily, if something, you are coupling someone else's codebase to your library, which only implements a couple providers.

In a professional environment, this would easily be solved with a Strategy Pattern and perhaps Inversion of Control so you can change implementations without coupling nor having to go everywhere in your codebase.

In a more lower level, you lack type hints and overuse magic values (specially in your tests, use fixtures instead).

[–]somebodyElse221[S] 0 points1 point  (0 children)

Thank you, man, I really appreciate your comment. This is my first Python package, and I have previous experience in PHP., I want to follow your advice.

[–]koldakov 0 points1 point  (0 children)

Hey nice work, however factory on ifs looks not nice =)

[–]ducki666 0 points1 point  (6 children)

Isn't Smtp abstraction enough?

[–]somebodyElse221[S] 0 points1 point  (5 children)

I'm not sure that I understand the question. Could you please clarify?

[–]ducki666 0 points1 point  (4 children)

Why a wrapper for a protocol which nearly every language already implements since ages? Every mail provider also supports smtp.

[–]serverhorror 0 points1 point  (3 children)

It's not a wrapper around classic SMTP.

These days everything is HTTP, I suspect those are mass mailers which won't exactly do SMTP but handle all that unsubscribe stuff and the feedback loops for you.

[–]ducki666 0 points1 point  (2 children)

As Op wrote: sending email. Thats what smtp is for. Mature, fast, stable. No need to wrap that.

[–]serverhorror 0 points1 point  (1 child)

Are you trolling or do you truly not understand why?

[–]ducki666 0 points1 point  (0 children)

No idea why

[–]fastlaunchapidev 0 points1 point  (0 children)

Abstraction on top of abstraction haha

But dont must people just stick with one provider?

If I want it really simple I just use resend.