Skip to content

Instantly share code, notes, and snippets.

View karwank's full-sized avatar

Karol Karwacki karwank

View GitHub Profile
@sobstel
sobstel / warden.rb
Last active January 24, 2020 18:36
Warden Rails cookie
Warden::Manager.after_authentication do |user, auth, _opts|
cookies = ActionDispatch::Request.new(auth.env).cookie_jar
cookies.encrypted[REMEMBER_ME_COOKIE_NAME] = { value: user.id, expires: 1.week.from_now }
end
@HendrikPetertje
HendrikPetertje / readme.md
Last active February 13, 2023 22:59
How to Make your own delivery methods in rails 4.+

Writing your own delivery method in Rails (4.+)

Imagine, you got your rails server and you need to send out a bunch of mails to your recipients. no big deal, but SMTP is just very slow when compared with things like simple HTTP API calls.

I set out a few days to write my own delivery method, but found online sources somewhat lacking, outdated or completely skipping this part of sending mails in rails. So lets start making a simple mail_delivery method that outputs the mail to a file in your project home.

You can change the postman step in this tutorial to match your API, etc. instead.