You [Gerald Bauer¹] have been permanently banned [for life] from participating in r/ruby (because of your writing off / outside of r/ruby). I do not see your participation adding anything to this [ruby] community.

-- Richard Schneeman (r/ruby mod and fanatic illiberal ultra leftie on a cancel culture mission)

¹: I know. Who cares? Who is this Gerald Bauer anyway. A random nobody for sure. It just happens that I am the admin among other things of Planet Ruby.

Case Studies of Code of Conduct "Cancel Culture" Out-Of-Control Power Abuse - Ruby - A Call for Tolerance On Ruby-Talk Results In Ban On Reddit Ruby

Update (August, 2022) - A Call for More Tolerance And Call For No-Ban Policy Results In Ban On Ruby-Talk (With No Reason Given)

>  I just banned gerald.bauer@gmail.com.
>
>  -- SHIBATA Hiroshi
>
>> THANK YOU
>> 
>>  -- Ryan Davis
>>
>>
>> My full support to moderators.
>>
>> -- Xavier Noria
>> 
>> My full support to moderators.
>>
>>  -- Carlo E. Prelz
>>
>>  That's fun.
>>
>>  -- Alice

Read the full story »


« 25 Days of Ruby Gems - Ruby Advent Calendar 2020, December 1st - December 25th

Day 7 - letter_opener Gem - Let Your Browser (Automagically) Open-Up Your Email Letters for Previewing. Stop Sending Emails to Yourself for Testing

Written by swanson Matt Swanson

Contrarian-in-training. Building products. Karl Pilkington is my spirit animal. Hacking on Boring Rails and Slotback Labs.

Have you ever sent yourself a test email?

You’re working on adding an email notification in your app and you need to try it out. Time to send yourself a test email…or two…or fifty… We’ve all done it.

But when you’re writing code for your Mailers, wouldn’t it be great if you could quickly preview the email message and iterate on the content?

Enter letter_opener.

Change how emails are ‘delivered’ in your development environment

Rails supports changing your application configuration based on environment. So, for example, you can change how emails are sent through ActionMailer on a per-environment basis.

The letter_opener gem takes advantage of this by allowing you to switch out how emails are sent. Instead of actually delivering an email notification from your code, the gem will instead open the email in your default browser so that you can preview the contents and inspect the contents (as well as the To, From, Subject, and other options).

While Rails does provide a mechanism to preview emails, letter_opener is much more convenient because you don’t have to write special previews for every email you want to test or manually visit the preview URLs. Any emails you send via ActionMailer will be intercepted and shown in the browser.

Configuring the gem

After installing the gem, simply make the following configuration changes in your config/environments/development.rb:

config.action_mailer.delivery_method = :letter_opener
config.action_mailer.perform_deliveries = true

Restart your application server if it was running and voila! Now you can preview emails in the browser and never resort to sending test emails to your personal account :).

Find Out More

References

Built with Ruby (running Jekyll) on 2023-01-25 18:05:39 +0000 in 0.371 seconds.
Hosted on GitHub Pages. </> Source on GitHub. (0) Dedicated to the public domain.