Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Last active June 7, 2019 09:27
Show Gist options
  • Save vparihar01/5591510 to your computer and use it in GitHub Desktop.
Save vparihar01/5591510 to your computer and use it in GitHub Desktop.
Just copy the user_mailers inside your Mailers directory and then inside user_mailers views move welcome_email_to_player.html.haml. Then user UserMailer.welcome_email_to_player.deliver. tada.... Your mail is sent. For out just check this test yomail account => [email protected].
class UserMailer < ActionMailer::Base
default :from => "[email protected]"
def welcome_email_to_player
attachments.inline['user_back'] = {
:data => File.read("#{Rails.root.to_s + '/app/assets/images/bg.jpg'}"),
:mime_type => "image/jpg",
:encoding => "base64"
}
mail(:to => "[email protected]", :subject => "Welcome to here")
end
end
This is test email for sending the email
= image_tag( attachments['user_back'].url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment