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

Base architecture #7

Merged
merged 46 commits into from
Sep 29, 2022
Merged

Base architecture #7

merged 46 commits into from
Sep 29, 2022

Conversation

abnegate
Copy link
Member

What does this PR do?

  • Add base Adapter class
  • Add base adapters for Email, SMS and Push
  • Add adapters for Mailgun, Twilio and FCM
  • Add mock adapters for Email and SMS (FCM could use request catcher, but investigating something more thorough)
  • Add tests for Email, SMS
  • Composer support
  • Docker support
  • GitHub workflows

Copy link
Member

@eldadfux eldadfux left a comment

Choose a reason for hiding this comment

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

A few suggestions:

  • I would add all adapters under an Adapters folder
  • All categories of adapters could still be at this path fore example: src/Utopia/Messaging/Adapters/Email/Mailgun.php
  • With the new directory structure, specific abstract don't need a postfix. For example: EmailAdapter.php can just be Email.php
  • Messages could be an independent directory alongside Adapters so each entity is independent. No need for a Message postfix we can leverage namespaces for that with the new dir structure.
  • We should prefer shorter naming conventions when possible. sendMessage() can be just send()

Copy link
Member

@eldadfux eldadfux left a comment

Choose a reason for hiding this comment

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

Great work Jake! Left a few comments

src/Utopia/Messaging/Adapters/Email/Email.php Outdated Show resolved Hide resolved
src/Utopia/Messaging/Adapters/Push/Push.php Outdated Show resolved Hide resolved

public function getMaxMessagesPerRequest(): int
{
return PHP_INT_MAX;
Copy link
Member

Choose a reason for hiding this comment

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

We will probably hit HTTP request size limit before that.

Copy link
Member Author

Choose a reason for hiding this comment

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

In that case the exception will propagate to the caller, the service has no limit, unless we want to apply an arbitrary one ourselves instead?

Copy link
Member

Choose a reason for hiding this comment

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

Not sure what might be the best approach, but we would need to take payload size to consideration at some point, either here or in Appwrite itself.

src/Utopia/Messaging/Adapters/SMS/Twilio.php Show resolved Hide resolved
@eldadfux eldadfux merged commit 501272f into main Sep 29, 2022
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.

2 participants