You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, the approach to this in the Mailgun provider (even though the API doesn't take an object), was to make the user change the provider name from Mailgun to let's say Example App. I myself don't think it's a good approach as this will, for example, change the default sign in button text from Sign in with Mailgun to Sign in with Example App, which could cause confusion - you're signing up to your app with your app.
I changed the EmailConfig type, rather made a new, inherited type, BrevoConfig (following the NodemailerConfig name) that does have the sender as an object with those 2 options:
I'm not sure whether the code that defines this interface is good as it is my first time using TS features such as Omit<>, but nevertheless, when I use the provider in the demo app it shows this error:
Type 'BrevoConfig' is not assignable to type 'Provider'.
Type 'BrevoConfig' is not assignable to type 'EmailConfig & InternalProviderOptions'.
Type 'BrevoConfig' is not assignable to type 'EmailConfig'.
Types of property 'from' are incompatible.
Type '{ name?: string | undefined; email: string; } | undefined' is not assignable to type 'string | undefined'.
Type '{ name?: string | undefined; email: string; }' is not assignable to type 'string'. ts(2322)
It runs just fine and works, but I'm not sure whether the error comes from VSCode because it is a demo app or maybe the type configuration should be reverted back to standard EmailConfig or should the EmailConfig type by default include separate fields for name and email.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to add a new email provider to the core package - Brevo (ex. Sendinblue)
[link to fork]
Brevo's API works in such a way, where the sender data is sent through a JSON object where the name and the email are separate, as seen below.
Now, the approach to this in the Mailgun provider (even though the API doesn't take an object), was to make the user change the provider name from
Mailgun
to let's sayExample App
. I myself don't think it's a good approach as this will, for example, change the default sign in button text fromSign in with Mailgun
toSign in with Example App
, which could cause confusion - you're signing up to your app with your app.I changed the EmailConfig type, rather made a new, inherited type, BrevoConfig (following the NodemailerConfig name) that does have the sender as an object with those 2 options:
I'm not sure whether the code that defines this interface is good as it is my first time using TS features such as
Omit<>
, but nevertheless, when I use the provider in the demo app it shows this error:It runs just fine and works, but I'm not sure whether the error comes from VSCode because it is a demo app or maybe the type configuration should be reverted back to standard EmailConfig or should the EmailConfig type by default include separate fields for name and email.
Beta Was this translation helpful? Give feedback.
All reactions