Cap-go / capgo

Instant update for capacitor apps
https://capgo.app
GNU Affero General Public License v3.0
115 stars 57 forks source link

Weekly email stats #277

Closed riderx closed 1 year ago

riderx commented 1 year ago

Describe the bug/issue The idea is to do a cron job, who send to active account an email every week to give them stats about they account. I will give the email content

riderx commented 1 year ago

/bounty 200

algora-pbc[bot] commented 1 year ago

๐Ÿ’Ž $200 bounty created by riderx ๐Ÿ™‹ If you start working on this, comment /attempt #277 to notify everyone ๐Ÿ‘‰ To claim this bounty, submit a pull request that includes the text /claim #277 somewhere in its body ๐Ÿ“ Before proceeding, please make sure you can receive payouts in your country ๐Ÿ’ต Payment arrives in your account 2-5 days after the bounty is rewarded ๐Ÿ’ฏ You keep 100% of the bounty award โ„น๏ธ If something is not clear ask before working on it, otherwise your chance to rework it is high ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Join the Discord to get help ๐Ÿ“ Check all Bounty rules ๐Ÿ™ Thank you for contributing to Cap-go/capgo!

Attempt Started (GMT+0) Solution
๐Ÿ”ด @evonloch Aug 19, 2023, 10:54:57 AM WIP
๐Ÿ”ด @rishi-raj-jain Aug 19, 2023, 12:47:49 PM WIP
๐Ÿ”ด @fvckDesa Aug 19, 2023, 12:48:18 PM WIP
๐Ÿ”ด @WcaleNieWolny Aug 28, 2023, 4:19:05 PM #359
evonloch commented 1 year ago

/attempt #277

Options
riderx commented 1 year ago

Email content:

Hello Capgo User,

We hope you're having a fantastic week! Here's your weekly dose of Capgo stats, served hot and fresh, just the way you like it!

Updates Dispatched: This week, we sent out a whopping {{ weekly_updates }} updates! That's like delivering {{fun_comparison}}!

Updates Installed: Out of these, {{ weekly_install }} found their new homes in user devices. That's a {{ weekly_install_success }}% success rate! High five!

Oops Moments: Unfortunately, {{ weekly_fail }} updates couldn't make it and tripped on the way. But don't worry, we're already working on their band-aids!

App Openings: Your app was the star of the show, being opened {{ weekly_open }} times this week! That's more popular than {{fun_comparison_2}}!

Time Spent: Users spent a total of {{ weekly_open_time }} hours on your app. That's equivalent to watching {{fun_comparison_3}}!

Remember, every update is a step forward, and we're here to make sure your steps are as smooth as possible. Keep rocking the app world, and we'll be back next week with more fun facts!

Stay Updated,
Your Capgo Team

Here is the variable content I want to add:

Updates Dispatched:

Little: "That's like delivering a cupcake to every student in a small school!"

Medium: "That's like delivering a pizza to every resident of a small town!"

Big: "That's like delivering a burger to everyone in a big city!"

Updates Installed:

Little: "That's a 90% success rate! Even cats don't land on their feet that often!"

Medium: "That's a success rate higher than the average pass rate of a tough university exam!"

Big: "That's a success rate that even the best basketball players would envy!"

App Openings:

Little: "Your app was opened more times than a popular local bakery's door!"

Medium: "Your app was more popular than the latest episode of a hit TV show!"

Big: "Your app was opened more times than a blockbuster movie on its opening weekend!"

Time Spent:

Little: "That's equivalent to watching the entire 'Finding Nemo' movie!"

Medium: "That's equivalent to watching the entire 'Lord of the Rings' trilogy!"

Big: "That's equivalent to watching the entire 'Game of Thrones' series!"

The email will be sent by plunk, the template is already created there, only the sentence variation will be done in code and the stats.

I can find a way to export data to have them in the seed if you need more.

riderx commented 1 year ago

The variable to be sent to plunk are:

{{ weekly_updates }}
{{ weekly_install }}
{{ weekly_install_success }}
{{ weekly_fail }}
{{ weekly_open }}
{{ weekly_open_time }}

This data exist in the database in raw form, you can calculate them, they should have they own table and be stored daily weekly and monthly.

For this:

{{fun_comparison}}
{{fun_comparison_2}}
{{fun_comparison_3}}

I let you propose what can be the threshold

rishi-raj-jain commented 1 year ago

/attempt #277 Can you guide me to where I can get the stats from?

Also, do you want to send it via resend.com?

Options
algora-pbc[bot] commented 1 year ago

Note: The user @evonloch is already attempting to complete issue #277 and claim the bounty. If you attempt to complete the same issue, there is a chance that @evonloch will complete the issue first, and be awarded the bounty. We recommend discussing with @evonloch and potentially collaborating on the same solution versus creating an alternate solution.

rishi-raj-jain commented 1 year ago

Given that evon cancelled his attempt, I'd love to get on this.

riderx commented 1 year ago

Let gooo @rishi-raj-jain :)

rishi-raj-jain commented 1 year ago

@riderx

Oh yes!

Can you show me how plunk works? Just a overall understanding with docs and links would be fine.

If possible, can you direct me to where do we expect/think the changes would be at?

riderx commented 1 year ago

https://docs.useplunk.com/guides/setting-up-automation you can also see in the current code how it's used. I already send email for plan usage

riderx commented 1 year ago

i'm not sure to understand your last question

rishi-raj-jain commented 1 year ago

@riderx

The check of a user being is isOnboarded, right?

algora-pbc[bot] commented 1 year ago

@evonloch: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then ๐Ÿ™

algora-pbc[bot] commented 1 year ago

@rishi-raj-jain: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then ๐Ÿ™

algora-pbc[bot] commented 1 year ago

@fvckDesa: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then ๐Ÿ™

fvckDesa commented 1 year ago

@rishi-raj-jain are you working on it or i can take care of it?

rishi-raj-jain commented 1 year ago

@fvckDesa Feel free to pick this up.

fvckDesa commented 1 year ago

/attempt #277

Options
baibhavKumar1 commented 1 year ago

The variable to be sent to plunk are:

{{ weekly_updates }}
{{ weekly_install }}
{{ weekly_install_success }}
{{ weekly_fail }}
{{ weekly_open }}
{{ weekly_open_time }}

This data exist in the database in raw form, you can calculate them, they should have they own table and be stored daily weekly and monthly.

For this:

{{fun_comparison}}
{{fun_comparison_2}}
{{fun_comparison_3}}

I let you propose what can be the threshold

Hi @riderx , @rishi-raj-jain mentioned that @fvckDesa can work on it, I don't know why he deleted it, if you can help me with where to get the data from, I have implementation ready. Thank You

riderx commented 1 year ago

For the data it's needed to write SQL function and call them from the Supabase SDK

fvckDesa commented 1 year ago

@Wholesomebruh I'm working on it, the bot automatically removed me after the 7th day

fvckDesa commented 1 year ago

@Wholesomebruh I have problem with supabase and now I can work on it, take care of it if you want

baibhavKumar1 commented 1 year ago

It's open then , as I am figuring out supabase too. If anyone can help with that, I have implementation ready, just need the variables from database. Thanks @fvckDesa for confirming.

WcaleNieWolny commented 1 year ago

/attempt #277

Options
WcaleNieWolny commented 1 year ago

About this: That's a {{ weekly_install_success }}% success rate! High five This is not really worded in the best way in my option.

Let's say that we will write something like

That's a success rate that even the best basketball players would envy! High five

it is all good, however what is the actual success rate? 90% 95%? 30%?

WcaleNieWolny commented 1 year ago

To confirm. We will create a new edge fn -> add cron timer in supabase for it -> from this edge fn we will get all of the contacts -> loop over them and use the trackEvent function to send the email?

WcaleNieWolny commented 1 year ago

As for the template, you made a lot of variable related mistakes when writing it.

{{ weekly_install_success }} will not work. {{weekly_install_success}} will work

riderx commented 1 year ago

exact, but i'm currently migrating the stats to app_usage so it's maybe not the best time to do this task, or use the new table for MAU, storage and bandwidth data

WcaleNieWolny commented 1 year ago

Thanks for letting me know, I will deal with merge conflicts as they emerge

WcaleNieWolny commented 1 year ago

I will do as much as I can (cron endpoint, perhaps improve wording a little bit) and when your stats impl is ready I will use that instead of the old stats

algora-pbc[bot] commented 1 year ago

@WcaleNieWolny: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then ๐Ÿ™

algora-pbc[bot] commented 1 year ago

The bounty is up for grabs! Everyone is welcome to /attempt #277 ๐Ÿ™Œ

WcaleNieWolny commented 1 year ago

I am still working on this, I worked on the org system last week and also the stats PR was not merged so I was unable to work on this

WcaleNieWolny commented 1 year ago

I suggest changing Little: "That's a 90% success rate! Even cats don't land on their feet that often!" to Little: "That's above 80% success rate! Even cats don't land on their feet that often!"

rishi-raj-jain commented 1 year ago

@WcaleNieWolny can i work on this

WcaleNieWolny commented 1 year ago

This is practically done here: https://github.com/WcaleNieWolny/capgo/tree/email_stats. I still need to test this and potentially improve the template but I had already wrote some code for this

algora-pbc[bot] commented 1 year ago

๐Ÿ’ก @WcaleNieWolny submitted a pull request that claims the bounty. You can visit your org dashboard to reward.

algora-pbc[bot] commented 1 year ago

๐ŸŽ‰๐ŸŽˆ @WcaleNieWolny has been awarded $200! ๐ŸŽˆ๐ŸŽŠ