Skip to content

Instantly share code, notes, and snippets.

@arkiver
Last active December 31, 2015 03:08
Show Gist options
  • Save arkiver/7925053 to your computer and use it in GitHub Desktop.
Save arkiver/7925053 to your computer and use it in GitHub Desktop.
Header for method devise invitable
User.invite!({:email => "[email protected]", :name => "name one"}, User.first)
def headers_for(action)
headers = {}
case action
when :invitation_instructions
headers.merge!({
:subject => self.invited_by ? self.invited_by.name.titleize + " invited you to MyApp" : "Invitation",
:reply_to => self.invited_by ? self.invited_by.to_e : "",
:from => self.invited_by ? "#{self.invited_by.name.gsub(/\W/, ' ').titleize} via MyApp <[email protected]>" : "MyApp <[email protected]>"
})
end
headers
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment