Last active
June 7, 2019 09:27
-
-
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].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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