Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add & automate update reminders to notification center & emails for verified project owners #932

Closed
WhyldWanderer opened this issue Mar 28, 2023 · 42 comments
Assignees
Labels
enhancement New feature or request p2

Comments

@WhyldWanderer
Copy link

Some project owners either don't check their email accounts or have unsubscribed from Giveth emails.
The verification team thinks that it is important to remind verified project owners that they need to add an update so that they dont lose their verified status.

Two notifications to be added to the notification center - these would be sent to verified projects

45 days without an update - friendly reminder: "Don't forget to add regular updates to your project to keep your verified status! - Learn more"

90 days without an update - "You have 14 days to add an update to avoid badge expiration - Learn more"

Something like that.

@WhyldWanderer WhyldWanderer changed the title Add update reminder to nitification center for verified project owners Add update reminder to notification center for verified project owners Mar 28, 2023
@MoeNick
Copy link
Member

MoeNick commented May 10, 2023

if @CarlosQ96 is busy this week you may like to take it @mohammadranjbarz , can you take a look?

@MoeNick MoeNick added the enhancement New feature or request label May 15, 2023
@NikolaCreatrix
Copy link

Hey hi guys, I would love to check in here to see if there is any chance to estimate when this can be implemented, please. @MoeNick @CarlosQ96 or @mohammadranjbarz

@mohammadranjbarz
Copy link
Collaborator

Hey hi guys, I would love to check in here to see if there is any chance to estimate when this can be implemented, please. @MoeNick @CarlosQ96 or @mohammadranjbarz

Hey @NikolaCreatrix @MoeNick I haven't looked over this issue, but as we need to modify something in notification-center and impact-graph I think it would last about 2-3 days( assuming copies are ready and there is no blocker)
@CarlosQ96 WDYT?

@MoeNick
Copy link
Member

MoeNick commented Jun 13, 2023

Let's plan for it next week.

@divine-comedian
Copy link
Collaborator

divine-comedian commented Aug 24, 2023

@MoeNick
Copy link
Member

MoeNick commented Aug 28, 2023

I talked with @mohammadranjbarz and he will take care of web and email notification of this issue. FOR THIS WEEK

@mohammadranjbarz
Copy link
Collaborator

Some project owners either don't check their email accounts or have unsubscribed from Giveth emails. The verification team thinks that it is important to remind verified project owners that they need to add an update so that they dont lose their verified status.

Two notifications to be added to the notification center - these would be sent to verified projects

45 days without an update - friendly reminder: "Don't forget to add regular updates to your project to keep your verified status! - Learn more"

90 days without an update - "You have 14 days to add an update to avoid badge expiration - Learn more"

Something like that.

@WhyldWanderer
What is the link for Learn More, after clicking on that, we should redirect to what URL?

@mohammadranjbarz
Copy link
Collaborator

@MoeNick @WhyldWanderer I guess also we need to pu project name in notification text that when use clicks on that redirect them to project's page like other notifications, so I think we should modify the notification texts

@WhyldWanderer
Copy link
Author

I guess also we need to pu project name in notification text that when use clicks on that redirect them to project's page like other notifications, so I think we should modify the notification texts

Maybe something like this:

  • 45 days without an update - friendly reminder: "[projectname] has not been updated in a while. Remember to add regular updates to your project to keep your verified status!"

    In this notification, they can click the project name and it should take them to "giveth.io/project/[projectslug]?tab=updates" for whichever project of theirs needs the update?

  • 90 days without an update - "You have 14 days to add an update to [projectname] to avoid badge expiration - Learn more"

    In this notification, "Learn more" should link to "youtu.be/sRhp74CcGU8?si=UWLAMVjIAiT_rO5y"

wdyt?

@mohammadranjbarz
Copy link
Collaborator

@WhyldWanderer @MoeNick

I saw we already use notification center for sending reminder emails, if we want to exactly send notifications when we are sending email so might not be needed to change impact-graph, we just need to modify some notificationTypes with copies that you provided to make it work

https://github.com/Giveth/impact-graph/blob/staging/src/services/cronJobs/checkProjectVerificationStatus.ts#L107-L150

WDYT?

@WhyldWanderer
Copy link
Author

Unfortunately no emails get sent due to Segment issues or something..
At this point we have no process for notifying the user that they need to add an update.

Does that change what you are suggesting?

@MoeNick
Copy link
Member

MoeNick commented Sep 12, 2023

@WhyldWanderer @MoeNick

I saw we already use notification center for sending reminder emails, if we want to exactly send notifications when we are sending email so might not be needed to change impact-graph, we just need to modify some notificationTypes with copies that you provided to make it work

https://github.com/Giveth/impact-graph/blob/staging/src/services/cronJobs/checkProjectVerificationStatus.ts#L107-L150

WDYT?

Yeah I think they are the exact events, but they have email templates and we need some copies with markup, so pls don't replace them, just duplicate them.

@mohammadranjbarz
Copy link
Collaborator

Unfortunately no emails get sent due to Segment issues or something.. At this point we have no process for notifying the user that they need to add an update.

Does that change what you are suggesting?

Woow I thought the email is working, let me investigate it I will keep you posted about it

@divine-comedian
Copy link
Collaborator

divine-comedian commented Sep 12, 2023

@mohammadranjbarz

Maybe we want to try out using the autopilot API directly to trigger the journey?

https://autopilot.docs.apiary.io/#reference/api-methods/trigger-journey

@mohammadranjbarz
Copy link
Collaborator

@mohammadranjbarz

Maybe we want to try out using the autopilot API directly to trigger the journey?

https://autopilot.docs.apiary.io/#reference/api-methods/trigger-journey

Yeah it can be a good idea, if we was Segment makes too much trouble and email loss ( and it's not because of our code) we can try it out

@mohammadranjbarz
Copy link
Collaborator

@WhyldWanderer @MoeNick @divine-comedian
The job that was supposed to check project updates and send emails for reminding project owners was disabled so it was the reason that we weren't send emails.

@CarlosQ96 Now I enabled that service with PROJECT_REVOKE_SERVICE_ACTIVE=true in Production ENV so we should wait to see what happens after that, I would appreciate if you can check what happens, we should create notifications and send emails ( send Segment events), if it wasn't it can be the bug in our code logic or related notification_type config in DB , ...

@MoeNick
Copy link
Member

MoeNick commented Sep 14, 2023

Do we have an autopilot template set for each event? @divine-comedian @WhyldWanderer

@WhyldWanderer
Copy link
Author

yep!
image

@WhyldWanderer
Copy link
Author

Can we make sure we arent actually revoking badges at this point though?

@mohammadranjbarz
Copy link
Collaborator

Can we make sure we arent actually revoking badges at this point though?

Until now the job was deactivate, but from now on it should work

@WhyldWanderer
Copy link
Author

WhyldWanderer commented Sep 14, 2023

Until now the job was deactivate, but from now on it should work

But just for emails right? It wont actually change the status in the db?

Im scared to revoke too many badges right away... it would be nice for people to start receiving the emails so that they know they need to add an update..

And then activate the badge revoking later after the users have had a chance to get caught up on updates

@mohammadranjbarz
Copy link
Collaborator

Until now the job was deactivate, but from now on it should work

But just for emails right? It wont actually change the status in the db?

Im scared to revoke too many badges right away... it would be nice for people to start receiving the emails so that they know they need to add an update..

And then activate the badge revoking later after the users have had a chance to get caught up on updates

If we want not revoke badges we can change PROJECT_UPDATES_VERIFIED_REVOKE_DAYS to a big number for instance make it 1000 days, to make sure not revoke badges ( because whole checking are one package so we can't enable some of them)

@WhyldWanderer
Copy link
Author

Okay.. that sounds good. Lets do that at first and then we can adjust later after people have had a chance to get reminded

Thanks Mohammad

@mohammadranjbarz
Copy link
Collaborator

Okay.. that sounds good. Lets do that at first and then we can adjust later after people have had a chance to get reminded

Thanks Mohammad

Done.

@divine-comedian divine-comedian changed the title Add update reminder to notification center for verified project owners Add & automate update reminders to notification center & emails for verified project owners Dec 7, 2023
aminlatifi added a commit that referenced this issue Dec 18, 2023
* Added fill snapshot round number back

* Removed blockNumber from snapshot in tests

* Added fill snapshot round number

* Fixed migrations to be compatible with removing blockNumber from history

* Improve networks filters in all projects query

related to #1096

* improve calculations priority queue

* upgrade master test env for new auth service server

* add tests for staging goerli and alfajores

* Fix test cases for alfadores network

related to #1096

* Fix test cases for alfadores network

related to #1096

* Update staging-pipeline.yml

* 1.16.0

* Changed balance aggregator query to get

* Fixed param passing to getLatestBalances of power balance aggregator

* 1.16.1

* Return list of active campaigns in projectBySlug web service

related to #1051

* rewrite totalReceived query

* Update totalReceived of project owners correctly after verifying donations

Giveth/giveth-dapps-v2#3021

* Update totalReceived of project owners correctly after verifying donations

Giveth/giveth-dapps-v2#3021

* Delete test user after some test cases

* Fix Auth microservice address in config

* Add cache to qfRound estimated matching queries

related to #1103

* removed unused code

* Add QF_ROUND_ESTIMATED_MATCHING_CACHE_DURATION to example.env

* add eligible donations to qfround entity

* add tests for qfround eligible donations

* add adminjs eligiblenetworks editable on qfround

* Update staging-pipeline.yml

Added staging DB to testing in the CI

* add labels to the networks in adminjs for qfround

* add migration to fill in previous networkIds in qfrounds

* fix eligible donations migration

* fix migration table names for qfround networks

* fix migration file for eligible networks

* fix qfround fill networks migration

* add query for knowing if wallet was used

* add query for knowing if wallet was used

* improve query for user related address

* improve query for user related address

* unify project counts in userByAddress and projectsByUserId

* unify project counts in userByAddress and projectsByUserId

* improve condition for projectCount

* fix projectCount query

* improve condition for projectCount

* fix projectCount query

* Add logs for checkProjectVerificationStatus to can investigate better

related to #932 (comment)

* Add Other types of campaigns to projectBySlug webservice

#1051 (comment)

* Fix calling remind project update notification and more logs

* Add more logs

* Change name of fetchProjectsBySlugQuery field

* add qfFilter with estimatedMatchingView

* add sorting by qfround raised funds

* Implement doesDonatedToProjectInQfRound webservice

related #1138

* Move caching project campaign slugs process to a separated worker

related #1051

* fix relationships for estimated matching filters

* Add ETC network

* Put campaign projects cache in redis instead of saving that in memory

* Change default value of CACHE_PROJECT_CAMPAIGNS_CRONJOB_EXPRESSION

* change to leftJoin on estimatedMatchingTable

* fix tests

* modify qfround filter join

* order null donations to last position

* add optimism data queries

* add graphql queries examples

* Add some logs

* Change default value of CACHE_PROJECT_CAMPAIGNS_CRONJOB_EXPRESSION

* Put calling updateInstantPowerBalances() in try..catch...

* Add comment

* 1.17.0

* Get giv price from givback-calculation instead of monoswap

* Add GIVETH_GIV_PRICES_URL in test.env

* Add some GLO and pyUSD stable coins

related to Giveth/giveth-dapps-v2#3221

* Call cacheProjectCampaigns() in main thread

* Fix filling xdai donation price

* Add octant donations to DB

* Fix test cases

* add idriss donation logic and cronjob

* Integrate with Mordor ETC testnet chain

related #1157, #1156

* Modify Octant donation migration file

* Fix migration file names for stable coins

* Fix build problem

* add creation of donation and user from idriss donation

* Fix donation resolver test case for etc testnet

* fix cache and improve optimism queries

* fix donations per category query for optimism

* Change date of Public Noun donation

* Add edit button for donation tab in admin panel

related to #1161

* improve query to count for optimism

* Add transactionId to filter in donation tab in admin panel

* simplify donation total for optimism

* fix cache key for analytics dashboard queries

* add optimism data queries

* add graphql queries examples

* fix cache and improve optimism queries

* fix donations per category query for optimism

* improve query to count for optimism

* simplify donation total for optimism

* fix cache key for analytics dashboard queries

* Add price adapters

* Fix editing donations tab

* add additional filters for optimism queries

* add eligible recipients for idriss donations loop

* fix cache for new filters

* add new cache with new filter params

* add additional filters for optimism queries

* fix cache for new filters

* add new cache with new filter params

* Get ETC prices for ETC and Mordor network tokens

related to #1156, #1157, #1158

* Add logs in price adapters

* finishing changes to idriss donation creation

* Fix Adding addresses to managingFunds

* Fix editing donations in adminjs panel

* fix date in idriss donation

* improve idriss integration

* add error catching for idriss

* fix monoswap prices for idriss donations

* 1.18.0

* Change migration name of AddExternalDonationsFields

* Rename migration files to fix the orders

* Rename migration files to fix the orders

* Comment unstable test case

* add subsquid subgraph to optimize idriss integration

* change idriss cronjob time

* add idriss donation export in adminJs as button

* idriss improvements

* fix idriss import queries

* fix project status fetching for idriss

* add project status to getVerificationFormByProjectId query

* add project status to getVerificationFormByProjectId query

* Add sent matching fund to total donations of project and total received of users

related to Giveth/giveth-dapps-v2#3386

* Fix test case for adding matching fund to toal donation amount of projects

* Add knownAsSybilAddress to user entity and adding export sybils data to admin panel

* Move get qfRound data buttons to qfRound tab

* Integrate googlesheet stuff with sybil analysis

* Fix types of QfRoundDonationRow

* Add some comments

* add project_actual_matching_view table

* Fix migraiton file for actual matching materialized views

* add qfRound Spreadhsheet logic and actualmatching

* add qfRound Spreadhsheet logic and actualmatching

* Fix emptyness of googlesheet

* Implement qfRoundStats webservice

related to Giveth/giveth-dapps-v2#3250

* Change allProjects webservice to support qfRoundSlug

related to Giveth/giveth-dapps-v2#3250

* Fix test cases to create qfRound

* Fix test cases to create qfRound

* Fix test cases to create qfRound

* Fix test cases to create qfRound

* Fix updateProjectWithVerificationForm

* Revert updateUserTotalReceived() funciton

* Fix updateUserTotalReceived() test case

* Fix updateUserTotalReceived() test case

* Fix mordor testnet node url

* Read node rpc urls from process.env instead of config

* Add log

* Fix etc provider url in github actions config

* Fix AddSlugToQfRound migration

* Insert donations to db based on distributed funds for qfRound projects

related to #1186

* Empty commit to trigger CI/CD

* Fix query to just add donation for qfRound histories that have full data

* Fix typo error

* Fix insertDonationsFromQfRoundHistory query

* Move ens address to constant parameter

* Fix integration tests for creating donations with matchingFund data

* Fix integration tests for creating donations with matchingFund data

* Fix integration tests for creating donations with matchingFund data

* Remove unused tests

* add safeTransaction to donation logic

* fix uniqueness index on donation table

* comment a network tests

* fix nullability of transactionId

* make nonce nullable for safe donations

* add nullability to nonce in createdonationResolver

* remove undefined clause from joi validations

* Fix insertDonationsFromQfRoundHistory when can not find corosponding address

* Call refreshProjectDonationSummaryView() immediately after insertDonationsFromQfRoundHistory)

* add validations for multisig donations

* add abis decoder for multisig transactions and parsers

* fetch from and to addresses correctly for multisig validations

* fix native token transfer for multisig transactions

* fix transaction amount in tests for multisig

* fix fromAddress edgecase for multisig

* make params options for transactionData

* Revert unwanted changes happend after merge

* Fixed issues happend after merge

* Fixed an issue in setting chainType in projectUpdate

---------

Co-authored-by: Mohammad Ranjbar Z <[email protected]>
Co-authored-by: Carlos <[email protected]>
Co-authored-by: Moe Shehab <[email protected]>
Co-authored-by: CarlosQ96 <[email protected]>
Co-authored-by: Krati Jain <[email protected]>
Co-authored-by: Mateo Daza <[email protected]>
@MoeNick
Copy link
Member

MoeNick commented Jan 18, 2024

OMG look at how many sprints we planned for it and we could not make it since Aug

Can we prioritize it @divine-comedian ?

@MoeNick
Copy link
Member

MoeNick commented Jan 29, 2024

A gentle reminder for this.

@divine-comedian
Copy link
Collaborator

I don't think we can prioritize it right now among the other BE projects being worked on

@divine-comedian
Copy link
Collaborator

divine-comedian commented Feb 2, 2024

@jainkrati

Can we look at this one as part of the email service migration as well?

The summary here is that we want to automate sending notifications/emails to projects who have not provided an update to their project in a while.. at intervals:

60 days - send them an email and notification with some reminder
90 days - send them an email and notification with some reminder
104 - send email, notification and change the project verified status in db to ready to revoke

the project review team does not want to automatically revoke verification - but know which projects are due so they can take action case by case.

What I understood from @mohammadranjbarz is that we had difficulties working with Segment and now since we are in the process of phasing out segment it would be a good time to take this one up.

Since this is a new feature and not an existing one that needs to be migrated I have marked it as p2.

@WhyldWanderer - does this summary seem correct?

@MoeNick MoeNick assigned jainkrati and unassigned mohammadranjbarz Feb 6, 2024
@jainkrati
Copy link
Collaborator

Yes we can take it up!

@RamRamez is all set to finish his current email migration tasks by this Friday. We can work on this monday / tuesday if all activities are created in Ortto for same. @divine-comedian would wait for you to confirm on the activity configuration for this.

@jainkrati jainkrati assigned RamRamez and unassigned jainkrati Feb 7, 2024
@divine-comedian
Copy link
Collaborator

Speaking with @mohammadranjbarz about this one - looks to be a complex & deep bug in the impact-graph that prevented this from happening - it was not related to ortto or segment.

He mentioned that himself and Carlos and probably you @jainkrati will need to work on debugging this one since it requires deep knowledge of the impact-graph

@MoeNick
Copy link
Member

MoeNick commented Feb 8, 2024

Thanks @divine-comedian
Shall I remove it from Ortto?

Where else do you think it can be categorized? I mean in which feature the value is going to be delivered to the user? (Product Wise)

Maybe we can convert it to an independent epic.

@divine-comedian
Copy link
Collaborator

Thanks @divine-comedian Shall I remove it from Ortto?

Where else do you think it can be categorized? I mean in which feature the value is going to be delivered to the user? (Product Wise)

Maybe we can convert it to an independent epic.

Let's keep it in Ortto - please don't change anything on those epics. It is a p2 and we should work in it to fully complete the migration I think

@WhyldWanderer
Copy link
Author

@WhyldWanderer - does this summary seem correct?

Seems great to me! Thanks Mitch <3
It is exciting to see attention on this issue. Let me know if there's anything I can do to help dig up the deep bug.

@divine-comedian
Copy link
Collaborator

@RamRamez - I added two new activites to Ortto - first update warning & second update warning

here is the snippet of the call for your reference - these body fields should all be familiar to you

first update warning

const https = require('https');

const data = `{
	"activities": [
		{
			"activity_id": "act:cm:first-update-warning",
			"attributes": {
				"str:cm:email": "example string value",
				"str:cm:projecttitle": "example string value",
				"str:cm:projectupdatelink": "example string value",
				"str:cm:userid": "example string value"
			},
			"fields": {
				"str::email": "[email protected]"
			},
			"location": {
				"source_ip": "172.217.4.1",
				"custom": null,
				"address": null
			}
		}
	],
	"merge_by": [
		"str::email"
	]
}`;

const options = {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'X-Api-Key': '{{ APIKey }}',
        'Content-Length': data.length
    }
};

const req = https.request('https://api-us.ortto.app/v1/activities/create', options, res => {
    res.on('data', d => {
        process.stdout.write(d);
    });
});

req.on('error', error => {
    console.error(error);
});
req.write(data);
req.end();

second update warning

const https = require('https');

const data = `{
	"activities": [
		{
			"activity_id": "act:cm:second-update-warning",
			"attributes": {
				"str:cm:email": "example string value",
				"str:cm:projecttitle": "example string value",
				"str:cm:projectupdatelink": "example string value",
				"str:cm:userid": "example string value"
			},
			"fields": {
				"str::email": "[email protected]"
			},
			"location": {
				"source_ip": "172.217.4.1",
				"custom": null,
				"address": null
			}
		}
	],
	"merge_by": [
		"str::email"
	]
}`;

const options = {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'X-Api-Key': '{{ APIKey }}',
        'Content-Length': data.length
    }
};

const req = https.request('https://api-us.ortto.app/v1/activities/create', options, res => {
    res.on('data', d => {
        process.stdout.write(d);
    });
});

req.on('error', error => {
    console.error(error);
});
req.write(data);
req.end();

@MoeNick
Copy link
Member

MoeNick commented Mar 3, 2024

@maryjaf to test.

@RamRamez
Copy link
Collaborator

RamRamez commented Mar 6, 2024

@maryjaf to test and verify

@maryjaf
Copy link
Collaborator

maryjaf commented Mar 7, 2024

Thanks @RamRamez I've tested and everything is ok

Warning email:
image

last chance:
image

I need to check with @divine-comedian or @WhyldWanderer to make sure that the current conditions are expected
-when the verification status is warning and I've received an email for that
-then I record an update for this project
-in this scenario I won't receive email second email correctly but my verification status remains "Warning"
Is this expected that the status won't be changed after adding update ?

@divine-comedian
Copy link
Collaborator

@maryjaf nice catch! When you provide an update to your project the status should be updated to the original state which is null

@maryjaf
Copy link
Collaborator

maryjaf commented Mar 13, 2024

Thanks @RamRamez all of open problems have been resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p2
Projects
None yet
Development

No branches or pull requests

9 participants