Giveth / giveth-dapps-v2

This project is the aggregation of GIVeconomy and Giveth.io DApps in a single repo
https://staging.giveth.io
GNU General Public License v3.0
63 stars 33 forks source link

Ensure the emails are going out to Amin, Mohammad & Lauren corresponding to each notify reward call #4194

Open laurenluz opened 5 months ago

laurenluz commented 5 months ago

As discussed in the last GIVeconomy call and in the discord

there was an issue with the last notify reward call where emails were not sent to Lauren & Amin (but mohammad got them!)

we are sun-setting dapp-mailer and so will need to migrate these emails to Ortto. The expectation is that an email gets sent to specific people (me, @aminlatifi & @mohammadranjbarz) each time notify reward gets called on either gnosis chain or optimism, so we can track it.

it should look like this:

image

@mohammadranjbarz who should take this issue?

aminlatifi commented 5 months ago

@laurenluz I received the optimism one, but around 2 hours later than the transaction time. cc @mohammadranjbarz

We shouldn't have received email for gnosis notify reward because I made it manually myself, and the script is not executed for it.

RamRamez commented 5 months ago

For the migration I think first we need to define an Ortto activity for this, but Mitch knows better than me. @divine-comedian wdyt?

divine-comedian commented 5 months ago

If we want to do it outside of the dapp mailer service (which I think we should move everything to Ortt) then yes.

Will also define a new source that will have its own API key.

What information fields need to be included in the response? what type are they? number/string etc..

laurenluz commented 5 months ago

well the email basically has this info: image

@mohammadranjbarz maybe you can give info on the type of fields, number string etc. that this email contains?

jainkrati commented 5 months ago

is it ready to be picked up @divine-comedian @RamRamez

divine-comedian commented 5 months ago

I need the details of what information fields need to be included so I can make the activity in Ortto

laurenluz commented 5 months ago

@mohammadranjbarz can you give the informatino fields? I don't know how to answer this question

mohammadranjbarz commented 5 months ago

I need the details of what information fields need to be included so I can make the activity in Ortto

@divine-comedian The table that Lauren has sent is enough, the left column is name of the fields, and you can assume all fields are string

divine-comedian commented 5 months ago

Here's the sample code you'll need to send in an https request to the ortto API @RamRamez knows how to format and send this.

You'll also need a new API key for this one as I've distinguished it as a new source. I will DM it to you.

When you send this http request with the info it will trigger the email sending to the specified contact

Endpoint

https.request('https://api-us.ortto.app/v1/activities/create

headers

 headers: {
        'Content-Type': 'application/json',
        'X-Api-Key': '{{ APIKey }}',
        'Content-Length': data.length
    }

body

{
    "activities": [
        {
            "activity_id": "act:cm:notify-reward",
            "attributes": {
                "dtz:cm:date": {
                    "year": 2024,
                    "month": 6,
                    "day": 12,
                    "timezone": "UTC"
                },
                               // this is a number
                "int:cm:round": 1718236417,
                                // these are strings
                "str:cm:amount": "example string value",
                "str:cm:contractaddress": "example string value",
                "str:cm:farm": "example string value",
                "str:cm:message": "example string value",
                "str:cm:network": "example string value",
                "str:cm:script": "example string value",
                "str:cm:transactionhash": "example string value"
            },
            "fields": {
                "str::email": "contact@email.com"
            },
        }
    ],
    "merge_by": [
        "str::email"
    ]
}
RamRamez commented 5 months ago

@ae2079 please take this if you have bandwidth FYI @jainkrati I assigned this issue to Ali

mohammadranjbarz commented 4 months ago

@ae2079 There is the code we use it https://github.com/Giveth/giv-token-contracts/blob/main/deployments/notifyRewardAmount/optimism/givpower_distribute_extended_may_2024.js#L64-L72

https://github.com/Giveth/giv-token-contracts/blob/main/deployments/mailService/mailService.js

We should change it to instead of requesting to dappmailer use ortto and also there are some scripts in the server ( that are not in the codes) we should all recipient emails there

laurenluz commented 4 months ago

@ae2079 was this finished?

mohammadranjbarz commented 4 months ago

@ae2079 was this finished?

@laurenluz Yes it's done, we just need to deploy and test it together, maybe Sunday we will do it

divine-comedian commented 3 months ago

they need to test it together - they have a call for it today - when we merge PR we test it on staging

it is from notify-reward bot, Ali has been onboarded. Better for someone to coach him, someone needs to have a call with Ali to test on staging before merging to giv-token-contract.

@aminlatifi should coordinate with devops to get access to server

aminlatifi commented 3 months ago

We can test when a candidate server is introduced by DevOps team for running the staging script. cc @mhmdksh @ae2079

jainkrati commented 2 months ago

hey @geleeroyale could you pls help

geleeroyale commented 2 months ago

Sure - we have a server up and running for this kind of thing.

@aminlatifi You have access to services.giveth.io which I would recommend. However - please ping me when you want to do it so we can do it together.

ae2079 commented 2 months ago

@geleeroyale Can you please send me the credentials to access this server?

divine-comedian commented 1 month ago

still in backlog until QACC is done