Tracardi / tracardi

TRACARDI is a new HOME for your customer data. TRACARDI is an Composable API-first solution for any company that need inexpensive CDP to intergrate with.
https://www.tracardi.com
Other
501 stars 92 forks source link

Write a plug-in for resend.com #845

Open atompie opened 10 months ago

atompie commented 10 months ago

Is your feature request related to a problem? Please describe. Resends some common maintenance when sending an email like deliver monitoring, etc.

Describe the solution you'd like Integrate resent with Tracardi as a plug-in

Please use their API not Python library as it is not async.

https://resend.com/docs/api-reference/introduction

Us our async client:

timeout = aiohttp.ClientTimeout(total=15)
        async with HttpClient(retries,
                              [200, 201, 202, 203],
                              timeout=timeout) as client:
            async with client.post(
                    url=f'someurl', 
                    headers={"Authorization": f"ApiKey {self.credentials.token}",
                             "Content Type": "application/json"},
                    ssl=False,
                    json=params
            ) as response:
                return response

We need the following plugin.

Please makes sure that you create a resource for Resend API

ryomahan commented 9 months ago

I read all the issue describe, there is one question:

What does Unsubscirbe do? What does it do in the API list of resend.com? Delete audience or contact?

@atompie can you help me understand this?

atompie commented 9 months ago

@ryomahan Delete contact: https://resend.com/docs/api-reference/contacts/delete-contact

atompie commented 9 months ago

@ryomahan You could try this approach to ease the plugin development: https://youtu.be/R_kr9mBAKAU

ryomahan commented 9 months ago

@atompie Hi, I start create plugin for this issue, and there is a new question:

how should I define Resend's API params?

method one

make every params as a FormField like:

image

method two

make all params as a Json FormField

atompie commented 9 months ago

What are these params? Maybe they will fit into the resource. Are the params connection related? Or rather define what data to send.

ryomahan commented 9 months ago

@atompie like this:

image

atompie commented 9 months ago

Ohh Ok then it goes into the form one by one. Like in the SMTP plugin.

ryomahan commented 9 months ago

Ohh Ok then it goes into the form one by one. Like in the SMTP plugin.

Luckly, I do like this, I'll push a alpha(just finish the send function) version PR tonight.