Returns user image.
# File app/mailers/base_mailer.rb, line 14 def attach_user_image(user) attachments.inline["#{user.name}.png"] = user.raw_image(:medium) rescue nil end
Sets the global attachments in all mail.
# File app/mailers/base_mailer.rb, line 8 def setup_global_attachments attachments.inline['header_logo.png'] = File.read(File.join(Rails.root, 'app/assets/images/tutorsnew.png')) attachments.inline['footer_content.png'] = File.read(File.join(Rails.root, 'app/assets/images/logo.png')) end
To get default email
# File app/mailers/base_mailer.rb, line 19 def setup_mail_from ActsAsTenant.current_tenant ? Configurations::General.default_mail_from : Rails.application.secrets.default_mail_from end