actionmailer

Delayed Jobs and Action Mailer

江枫思渺然 提交于 2019-12-01 19:03:45
I am having trouble with implementing delayed jobs with my ActionMailer: Before Delayed Job Implementation: class NotificationsMailer < ActionMailer::Base default :from => "noreply@mycompany.com" default :to => "info@mycompany.com" def new_message(message) @message = message mail(:subject => "[Company Notification] #{message.subject}") end end and called it using this line (it worked perfectly fine): NotificationsMailer.new_message(@message).deliver After the Delayed Job implementation all i did was change the deliver line to: NotificationsMailer.delay.new_message(@message) In addition, I

Rails 3: action mailer not usng the :from => parameters

余生长醉 提交于 2019-12-01 10:29:21
Hi guys I'm trying to get emails running for a "Contact" page and the emails are coming through just fine but the problem is that the "from" field won't show my :from => "" that's inside my mailer method. The same thing happens with my recover password function which is below. The email which persists in the 'from' field is "myusername@gmail.com" from the smtp settings. Really appreciate the any help with this! I'm using Gmail and setup my smtp settings like this: config/initializers/mailer_setup ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain =>

Rails 3: action mailer not usng the :from => parameters

眉间皱痕 提交于 2019-12-01 09:24:11
问题 Hi guys I'm trying to get emails running for a "Contact" page and the emails are coming through just fine but the problem is that the "from" field won't show my :from => "" that's inside my mailer method. The same thing happens with my recover password function which is below. The email which persists in the 'from' field is "myusername@gmail.com" from the smtp settings. Really appreciate the any help with this! I'm using Gmail and setup my smtp settings like this: config/initializers/mailer

Rails: ParameterFilter::compiled_filter tries to dup symbol

爷,独闯天下 提交于 2019-12-01 06:31:14
I'm running rails3 with rails exception-notifier gem. When an exception occurs, and an email should be sent, I'm getting an exception from the ParameterFilter class. I've found the problem in the rails source, and am not sure the best way to proceed. The problem occurs in ActionDispatch::Http::ParameterFilter. In the compiled_filter method, an error occurs on line 38: key = key.dup when key is a symbol, because symbols are not duplicable. Here is the source: def compiled_filter ... elsif blocks.present? key = key.dup value = value.dup if value.duplicable? blocks.each { |b| b.call(key, value) }

Rails mail interceptor only for a specific mailer

浪尽此生 提交于 2019-12-01 06:20:45
I have an interceptor : DevelopmentMailInterceptor and an inititializer setup_mail.rb that initiates the interceptor. But I want to apply it to a specific mailer (to intercept NotificationMailer and not the other ones. So I set in setup_mail.rb : `NotificationMailer.register_interceptor(DevelopmentMailInterceptor) But then all mailers get intercepted, as if I'd written ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) How can I filter this? Augustin Riedinger I found the solution by exploring in depth the message parameter of the delivering_email method of the mailer

Rails - ActionMailer sometimes shows attachments before the email content?

谁说我不能喝 提交于 2019-12-01 05:56:27
How can I make it so ActionMailer always shows attachments at the bottom of the message: HTML, TXT, Attachments.... Problem is the attachment here is a text file: ----==_mimepart_4d8f976d6359a_4f0d15a519e35138763f4 Date: Sun, 27 Mar 2011 13:00:45 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=x00_129999.olk14message Content-ID: <4d8f976d49c72_4f0d15a519e351387611f@railgun64.53331.mail> Thanks I had the same problem, and in my case the solution was to swap the attachment and mail lines. First attach,

Rails - ActionMailer sometimes shows attachments before the email content?

倖福魔咒の 提交于 2019-12-01 02:56:52
问题 How can I make it so ActionMailer always shows attachments at the bottom of the message: HTML, TXT, Attachments.... Problem is the attachment here is a text file: ----==_mimepart_4d8f976d6359a_4f0d15a519e35138763f4 Date: Sun, 27 Mar 2011 13:00:45 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=x00_129999.olk14message Content-ID: <4d8f976d49c72_4f0d15a519e351387611f@railgun64.53331.mail> Thanks 回答1: I

How can I use assets within Mailer?

我们两清 提交于 2019-11-30 15:40:29
问题 I have trouble using any form of the asset pipeline within mailer, wether the Mailer itself or the view. The following produces and empty src image tag. <%= image_tag "emails/header-general.png" %> The empty image tag looks like this: img alt="Header-general" The following form of attaching a file through the model and using it in the view attaches an empty image. attachments.inline['header.jpg'] = 'emails/header-general.png' ... <%= image_tag attachments['header.png'] %> I did check the path

CSS Images in Email With Rails 3

大城市里の小女人 提交于 2019-11-30 15:33:12
I'm trying to send out an email with Rails 3 and Action Mailer. The email goes out fine, but I want it to be HTML formatted with some basic styling which includes background images. I understand that the images might get blocked until the user allows them to be shown, but I still think it would be best to link to the images on my web server. The email template called registration_confirmation.html.erb starts out like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

How to configure action mailer (should I register domain)?

£可爱£侵袭症+ 提交于 2019-11-30 15:09:44
问题 I am creating a simple non-profit application with Ruby on Rails. I have to set up the following settings in order to be able to send emails with Gmail: Depot::Application.configure do config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address:"smtp.gmail.com", port:587, domain:"domain.of.sender.net", authentication: "plain", user_name:"dave", password:"secret", enable_starttls_auto: true } end I am completely new with this stuff and have no idea what exactly