Briskine / briskine

Write faster with templates and keyboard shortcuts.
https://www.briskine.com/
GNU General Public License v3.0
108 stars 23 forks source link

Add a variable for email without the domain name. #488

Closed DanKaplanSES closed 11 months ago

DanKaplanSES commented 1 year ago

Why we need it

Many of the email addresses I send emails to have no first or last name, just the email address. If all I know about someone's personal details are their name, like abc123@def.com, there isn't a good option to email them in bulk.

  1. I could skip the "Dear __," line, but that looks impersonal.
  2. I could start the emails with "Dear abc123@def.com," but that doesn't seem normal. If someone emailed me like that, I'd think it was an automated message.
  3. I could choose to email each one individually, starting each email with "Dear abc123,"; this is inefficient.

What we need

If I only have an email address, I'd like to be able to start abc123@def.com's email with "Dear abc123,". If/when this is implemented, there are a a lot of desirable improvements that could be added next (perhaps as separate issue(s)).

ghinda commented 11 months ago

You can now do all of this with template helpers: https://help.briskine.com/category/template-helpers/

Get the first part of an email address: {{lookup (text "name@email.com" "split" "@") 0}}

Capitalize it: {{capitalize (lookup (text "name@email.com" "split" "@") 0)}}

Replace hyphens from name: {{text (lookup (text "full-name@email.com" "split" "@") 0) "replace" "-" " "}}

Fallbacks: {{or to.first_name "default first name"}}