postiz-app
postiz-app copied to clipboard
🚀 Feature: Create an infrastructure for sending emails with different providers
🔖 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
EmailServiceto 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
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?
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
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
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.
I believe one of the most useful first additions would be a universal SMTP sender, which most providers support some way.
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 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.