Spectrum: Re-add the rep counter in digest emails

Created on 7 Nov 2017  路  14Comments  路  Source: withspectrum/spectrum

We would previously add a small snippet at the top of daily and weekly digest emails which told people how much rep they gained for their contributions in that timeframe. We took it out for two reasons:

  1. The strings were a bit verbose, and pushed down the core content of the digests
  2. We had a semi-snarky attitude in the strings for people who gained 0 rep in that time period

All of the code still exists though, and just needs to have some copy work done and re-added to the email template.

See:

  • chronos/queues/digests/processDigestEmail.js
  • chronos/queues/digests/processReputation.js

Those two files construct a string which gets sent to hermes/queues/send-digest-email.js

That reputationString is already getting sent into the email template, but just needs to be rendered in email-templates/weeklyDigest.html

Feature Quick Win good first issue

All 14 comments

This may need more details before someone less familiar with the codebase can take it on.

Updated description!

cc @mxstbr - Danger closed this issue even though it was created before the issue template existed.

I can jump on this -- a couple questions:

All of the code still exists though, and just needs to have some copy work done and re-added to the email template.

  1. Is the copy in processReputation.js updated?
  2. Where in the body of the email should it appear?

related but not relevant question -- do the html files in email-templates get used or are you pasting them into the Postmark template editor?

// email-templates/styles.css
/*

Note:
This css file should be used in *every* email template to maintain consistency.
Do not make changes to an individual emails styles. Update the styles here and 
update *every* template with the new css.

Eventually we should automate this as a build process.

*/

Is there an issue for this?

@good-idea not yet! PRs welcome :blush:

@good-idea

  1. Not yet!
  2. Not sure :P Sorry to be so vague here; I'd imagine one line above the list of daily digest threads might look okay

And after the template is updated here I'll manually paste it over to Postmark

This makes me want to convert https://github.com/uberbryn/mailchute to react/styled-components so we could build our emails that way and have it all come from centralized source 馃

@uberbryn https://mjml.io?

@mxstbr Ideally we wouldn't need another syntax - just a slightly different set of components.

@mxstbr @uberbryn I'm doing something similar with email templates in something I'm working on right now. We're sending an HTML body straight to postmark, though, instead of using their templates (We didn't want to bother with copying & pasting every time there's a change).

This is it in its most basic form. It's written from memory and pretty incomplete, but gets the idea across:

https://gist.github.com/good-idea/3f20c9d19c5412aa50f017ab9f266d0a

Doing it this way means less overhead with other packages or services, we don't need to deal with templating languages & files, and we're also able to test, snapshot, and export previews of all of our emails. It's definitely not as robust as MailChute or other options but has been a quick way to get us rolling.

@good-idea really interesting, going to study that a bit later and see how you're approaching it. Overall @mxstbr @uberbryn I really would like to not switch providers at this point given we're doing okay with what we have and I'm fine owning the pain points here :)

We did this!

Was this page helpful?
0 / 5 - 0 ratings