For a long time now I have tried to find a way to format code blocks in my emails, and I just can’t come up with anything good. What I wish I could do is just type some backticks around my code block, and have it format itself just like it would if I posted it on Stack Exchange or whatever. But I’m sending emails from Outlook, so that won’t work.
My current solution is to keep a formatted code block that I made in Craft with some placeholder code saved in a draft email. Then, when I want to put a code block in an email, I copy that block out of the draft and paste my code in. That works ok, but it’s clunky, and I can’t put code into a sentence
like this. Emails can render html, so it seems like I should be able to rig up somethingt with Alfred or Keyboard Maestro or something that would take code from my clipboard and give it a grey background and some mono space font to distinguish it from the rest of the email text, but I can’t figure it out.
I would love to hear from others who have found a better method for this than I have.