postiz-app icon indicating copy to clipboard operation
postiz-app copied to clipboard

🚀 Feature: Create an infrastructure for sending emails with different providers

Open nevo-david opened this issue 1 year ago • 7 comments

🔖 Feature description

Currently, Resend is the default provider for sending emails, but it might not be the ultimate solution for everybody. We need to implement an infrastructure to add different providers (same as we have in the login)

🎤 Why is this feature needed ?

✌️ How do you aim to achieve this?

  • Create an interface that contains one function - send emails
  • Create a ProviderFactory that decides what email provider to take based on the variable EMAIL_PROVIDER
  • Modify EmailService to take the right provider.

🔄️ Additional Information

No response

👀 Have you spent some time to check if this feature request has been raised before?

  • [X] I checked and didn't find similar issue

Are you willing to submit PR?

None

nevo-david avatar Mar 19 '24 14:03 nevo-david

So the ProviderFactory chooses the email provider as random or on what basis ? Also is it really a good thing to have multiple email providers lined up i mean the cost and all?

Deepankar20 avatar May 01 '24 18:05 Deepankar20

So the ProviderFactory chooses the email provider as random or on what basis ? Also is it really a good thing to have multiple email providers lined up i mean the cost and all?

I think this sould be defined by default for now or maybe based on a environment var. What do you think @nevo-david

joset98 avatar May 01 '24 20:05 joset98

Hi @Deepankar20, it's not random :) You will have to specify the email provider you want to use in the env variables like @joset98 said

nevo-david avatar May 02 '24 02:05 nevo-david

hey @nevo-david ! so i am thinking of adding sendGrid, postmark and mailerSender providers so let me know if more than these options are required. Also I have to figure out the way you are using resend to complemetely understand the implementation of this feature so it will take me some time finsh up.

Deepankar20 avatar May 11 '24 07:05 Deepankar20

I believe one of the most useful first additions would be a universal SMTP sender, which most providers support some way.

DerLeole avatar Sep 03 '24 12:09 DerLeole

There is one pull request here, but it's a bit old, I will check it and merge it @DerLeole https://github.com/gitroomhq/postiz-app/pull/172/files

nevo-david avatar Sep 03 '24 12:09 nevo-david

@nevo-david Awesome, thank you! It looks like that doesn't implement an SMTP provider yet, but I can use the structure setup in the PR to quickly develop my own and create a seperate PR for that.

DerLeole avatar Sep 03 '24 12:09 DerLeole