actionmailer

How Do I Prevent Email Attachments from Rendering Inline using ActionMailer

I am using the following code to send an email with a pdf attachment: class StudyMailer < ActionMailer::Base def notify_office(study, sent_at = Time.now) subject "Email Subject Goes Here" recipients '[email protected]' from "#{study.sender.full_name} <#{study.sender.email}>" sent_on sent_at body :s...

ActionMailer emails "sent" in development.log, but not received

I'm having problems actually sending via ActionMailer in development, on my localhost, with Rails 2.3.2 and Ruby 1.8.6. The development.log shows that it has "sent" the email with no errors, but the email is not received. I have tried multiple email addresses for sending and receiving and have tried multiple configs and plugins, but cann...

Rails ActionMailer problems on Mac

I've been working on learning to use Rails the last couple days and I've run into something that I haven't been able to solve with Google. So I'm just creating a basic contact form that sends an email. Everything seems to be working ok in testing, which tells me that the form is working, and ActionMailer was implemented correctly, howev...

Gmail does not detect the reply-to field.

Hi, I have following settings in my FeedbackMailer. def notification(feedback) from "[email protected]" subject "Some feedback" recipients "[email protected]" reply_to feedback.creator.email body({ :feedback => feedback }) content_type "text/html" end I am using [email protected] account to send emails for this appl...

email sent status from rails or actionmailer

Hi, I am developing a test application and running the whole thing on my work pc. I am using my corporate mail server to send mails. It works fine normally. I was wondering how to handle any conditions like if the mail server is not reachable from my pc. As far as i have read about it, the rails application just sends the mail and that'...

Rails Actionmailer Attachment Using Paperclip

Hi I have an email messaging system built within my application. There are many different users that can sign on and send emails to certain groups of people. I want to add the capability to send an attachment with these emails. I have no problem getting a set attachment from my HD to send, but clearly I need to allow users to add an att...

Rails intializers folder

I'm having a little trouble understanding how the files inside the intializers folder is used. Are all the files within this directory loaded automatically? Or do we need to specify which ones in some location? The above question came into play because I wanted to setup action mailer. I created a file called smtp_gmail.rb inside this fo...

Rails - How do you test ActionMailer sent a specific email in tests

Currently in my tests I do something like this to test if an email is queued to be sent assert_difference('ActionMailer::Base.deliveries.size', 1) do get :create_from_spreedly, {:user_id => @logged_in_user.id} end but if i a controller action can send two different emails i.e. one to the user if sign up goes fi...

Managing critical errors: logging & email

What's the best way to send quick one-liner e-mails to an administrative address in Rails? I am using the Rails Logger to keep track of nasty problems in my application. One of my controllers is doing mission-critical work and I need to know of any errors ASAP. When there is an error, I would like my app to send an email to myself, ca...

How do you use an instance variable with mailer in Ruby on Rails?

I created an instance variable (@user) in the model of a mailer and want to access it in the view? But it's giving me an an error (@user = nil). What's the best way to pass a variable to view (the email body)? Thanks, Chirag ...

Who Creates Custom ActionMailer Layouts in Rails, You or the Client?

When projects get large, I imagine you might start having 100s of mailer templates: user_signup_confirmation.html.erb user_signup_failure.html.erb user_account_activation.html.erb user_account_cancelation.html.erb ... What is your workflow for handling this? Do you have them email you what they want and then you mold it into a metho...

Can I look at Mailer views without actually sending an e-mail?

I think this may be a common situation… I'm working on a password recovery system for a Rails app that sends a link to the user to trigger a new password form. Pretty standard stuff. On my development server I don't have any mail-sending software enabled or configured (sendmail, SMTP settings, etc.) In config/environments/development.rb...

RoR: Saving rendered emails as HTML for linking in email.

Like it is in many newsletter services, I want to use Ruby on Rails to write a Newsletter. Now I want to provide a link in this email to view this newsletter in a browser, if the email is not shown correctly in Email Client. How can I do this? ...

Mailing Multiple Users Syntax

I am trying to send an email to multiple users. I have a model that sends @users, which has all of the users I am going to be mailing... now when in the User_mailer I am having trouble figuring out how to tell the mail_out process to send to each of the users (set each recipient the user.email). To summarize, I want to set a cron job to ...

Rails: generate a full URL in an ActionMailer view

I'm using ActionMailer to send a sign up confirmation email. The email needs to contain a link back to the site to verify the user, but I can't persuade Rails to generate a full URL (including the domain etc). I'm using: <%= url_for :controller => 'login', :action => 'verify', :guid => @user.new_user.guid, :only_path => false, :host =...

Rails - How do I use full email addresses without triggering Net::SMTPFatalError?

I am new to rails and using rails-2.3.5 and ruby-1.8.7. Here is my notifier.rb model: # app/models/notifier.rb class Notifier < ActionMailer::Base default_url_options[:host] = "foo.com" #This method sends an email with token to users who request a new password def password_reset_instructions(user) subject "Password ...

Rails or Ruby method to auto wrap lines for plain text email

I am building a comment notification system in Rails and I am trying to render user provided comments in a plain text email. When I render the comment, I want to auto wrap the lines when 56 characters are reached. Obviously I don't want to split words. Is there a function in Ruby or RoR for doing this, or do I need to roll my own? Qu...

Rails app won't send emails in production mode

Hey, I'm using Rails 2.3.5 and using rufus scheduler to send periodic emails. This works fine in development mode, but surprise surprise production mode has borked something. I've set the same actionmailer settings in both development and production files. Is there something I am missing? ...

ActionMailer password security

Am I crazy, or is it a bad idea to keep my SMTP username and password for ActionMailer in the actual (development/production) config file? It seems like I should store it an encrypted place, or at the very minimum, exclude it from my Mercurial pushes. Right now, I'm just removing the password from my source file before performing a push...

How to send emails with return-receipts in Ruby on Rails?

Hi everybody, I have to send automatic emails with Return Receipt (aka "acknowledgement of receipt"), to have the confirmation that the receiver have actually received and read the email. The confirmation is a simple email sent to a specified address (the "Disposition-Notification-To" address, given in the email header). Do you know if...