koo5 / koordinator2000

crowd-defunding
https://netlify--blissful-nobel-7b9749.netlify.app/
GNU Affero General Public License v3.0
10 stars 1 forks source link

send out emails #32

Open koo5 opened 3 years ago

koo5 commented 3 years ago

user table has email field, which is populated automatically when social login is linked. now we need to use that. 12:22 AM ] koo5 : @Lachlan so i guess what we should do wrt e-mailing is to simply send an email when a first "threshold reached" notification is created [ 12:23 AM ] koo5 : so, that's pretty much only when there isnt any notification with a given user id and campaign id [ 12:23 AM ] koo5 : we'll just say "hey, time to act!" and link to /notifications, or something [ 12:25 AM ] koo5 : over the next few days i'm gonna clean up the nhost migration commits, and merge [ 12:25 AM ] Lachlan : What if we reach 50/50 [ 12:25 AM ] Lachlan : or like 50% of goal [ 12:25 AM ] koo5 : 50 what? [ 12:25 AM ] Lachlan : example sorry [ 12:26 AM ] Lachlan : Like if we reach 100% of participants or like a 50% goal of participants [ 12:26 AM ] koo5 : i guess it could/should be an option to receive an email in that case [ 12:27 AM ] koo5 : or... could be weekly updates or somesuch [ 12:27 AM ] Lachlan : Yeah for upcoming campaigns or for joined campaigns? [ 12:27 AM ] koo5 : either hehe [ 12:28 AM ] koo5 : it's a literally endless space of possibilities :neutral_face: [ 12:29 AM ] koo5 : if you feel strongly about a particular option, we can build it [ 12:29 AM ] koo5 : in [ 12:31 AM ] koo5 : sorry, im tired, it was a pretty frustrating day, messing with database imports, overwritten system tables, figuring out how to propagate configs and other crap like that:) [ 12:33 AM ] Lachlan : All good. Ill have a think about best email practices [ 12:33 AM ] koo5 : and sure enough there are still some problems left :slight_smile: [ 12:33 AM ] koo5 : awesome [ 12:34 AM ] koo5 : yeah i've occasionally been pondering it until now, and all i can come up with is what i wrote above, to send a single e-mail when the threshold is reached, and not worry about more complex cases for now [ 12:36 AM ] koo5 : there should possibly be a view that lists campaigns, but only those you're participating in, and where a threshold is reached. Possibly could be the dashboard that active users'd see first [ 12:36 AM ] koo5 : notifications should stay low level as they are i think - notifying of every change, not trying to be something high level [ 12:37 AM ] koo5 : but hey, your turn to think about it:) [ 12:39 AM ] koo5 : as a technical aspect, we should have a table that keeps track of what messages were sent or are yet supposed to be sent, because email services and IM bots go offline etc

koo5 commented 3 years ago

Nodemailer (v1.0+)

const transport = nodemailer.createTransport({ port: 1025, ignoreTLS: true, // other settings... });

https://github.com/maildev/maildev

https://github.com/compdemocracy/polis/blob/f731bb657817aa1583e00a3ee67cd712a4bd7db0/docker-compose.yml#L112

https://github.com/compdemocracy/polis/blob/dev/docs/deployment.md#email-transports