actionmailer

Rails 3: Trying to extend Action Mailer with a module

守給你的承諾、 提交于 2020-01-05 08:11:32
问题 Trying to rewrite an old alias_method_chain to add a filter on outgoing emails, and it isn't working. I'm pretty sure I've leaving something out/missing something, but I don't know what. This file is in /lib/outgoing_mail_filter.rb, which is loaded with config/initializers/required.rb Here's the old code that worked under Rails 2: class ActionMailer::Base def deliver_with_recipient_filter!(mail = @mail) unless 'production' == Rails.env mail.to = mail.to.to_a.delete_if do |to| !(to.ends_with?(

ActionMailer Timing out

不羁岁月 提交于 2020-01-05 04:12:33
问题 I'm using Rails 3.2.17 and ActionMailer to send out emails. In the development environment I used my google account to send email and it worked fine. On production, with the production email settings it's timing out. To verify I copied over the production settings to dev. Currently it's failing with very little info: Rendered notifications_mailer/access_granted.html.haml (2.8ms) Rendered notifications_mailer/access_granted.text.haml (1.5ms) E, [2014-03-27T12:15:16.066641 #36665] ERROR -- :

Rails 3.2.8 Actionmailer - stack level too deep PLUS uninitialized constant Mail::Ruby19

这一生的挚爱 提交于 2020-01-05 02:31:17
问题 I'm following a tutorial referenced in a StackOverflow post for a simple contact form. Tutorial is here: http://matharvard.ca/posts/2011/aug/22/contact-form-in-rails-3/ Everything is copy/paste and change a few values for my domain and mail settings. Running into two very strange errors: When I first submit the contact form, I get a : stack level too deep Rails.root: /Users/me/application Application Trace | Framework Trace | Full Trace This error occurred while loading the following files:

How to set devise mails sender name?

浪尽此生 提交于 2020-01-04 06:32:13
问题 I am using rails devise gem. Devise sends cofirmation email to new users. Actionmailer is configured to use my gmail account to send emails. The email is sent by sender: "no-reply@myapp.com" which is my actionmailer global username configuration. I want to set sender to include my name " Mahmoud Khaled no-reply@myapp.com" And for sure I can't update actionmailer username configration to include name because it should be only GMAIL username. Any help how can i set devise from parameter? 回答1:

Rails 2 Mailer View Prepending 3D to strings

瘦欲@ 提交于 2020-01-04 04:21:15
问题 I have a very old rails app that is trying to send verification emails for new users but the token can never be found because for some reason the link gets 3D prepended to the string no matter how I generate the link. It also seems to be injecting an = sign into the middle of the token for some reason. Here's some code with output: <%= link_to verify_account_url(:host => (ActionMailer::Base.default_url_options[:host] || ''), :t => @token), verify_account_url(:host => (ActionMailer::Base

UserMailer with Devise

拈花ヽ惹草 提交于 2020-01-02 23:09:34
问题 am using my custom mailer UserMailer to send emails. It works perfect in development, but in production i get error 500, that is when am trying to retrieve my password on forgetting. here is what is in the production logs in the production mode Processing by Devise::PasswordsController#create as HTML Parameters: {"utf8"=>"✓","authenticity_token"=>"xxxxxxxxxxxxxxx", "user"=>{"email"=>"sam@gmail.com"}, "commit"=>"Send me r$ Completed 500 Internal Server Error in 2ms NameError (uninitialized

Can I send email from different addresses using same ActionMailer

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 07:37:19
问题 I'm using ActionMailer for my Rails 2.3.9 application. When I send an email using: deliver_user_invite config: def user_invite(subject, content) subject subject from "User Invite <invite@mydomain.com>" recipients "invites@mydomain.com" sent_on Time.now content_type "text/html" body :content => content end with SMTP configuration config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => 'smtp.gmail.com', :port => 587, :domain => 'mydomain.com', :authentication => :plain

Rails 2.3.9 and SendGrid, Connection refused - connect(2) on localhost

巧了我就是萌 提交于 2020-01-02 07:04:44
问题 I've looked through Google and StackOverflow and can't figure this out. I've got a Rails 2.3.9 app using Ruby 1.8.7, trying to send email through SMTP like so: ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid.net", :port => '25', :domain => "************.com", :authentication => :plain, :user_name => "***********", :password => "**********" } My app backtrace looks like this: /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net

How to change the mailer Content-Transfer-Encoding settings in Rails?

折月煮酒 提交于 2020-01-02 02:48:07
问题 The 'Content-Transfer-Encoding' setting is set to '7bit' by default. The mail server Postfix is breaking down the email header by bunch of 1000 caracteres, meaning that if you have a long email (using HTML for example), you end up having spaces in the middle of your text or links. (See this thread for more info: http://tech.groups.yahoo.com/group/postfix-users/message/273296) Following the Rails ActionMailer documentation (http://api.rubyonrails.org/classes/ActionMailer/Base.html), adding the

rails mailer with different layouts

▼魔方 西西 提交于 2020-01-01 09:32:49
问题 I use one layout for all my emails in my Notifier model (20+ emails)... however sometimes I just want to send a plain text email with no layout or html at all. I can't seem to be able to figure out how? If I try to send a plain text email i still get the layout, and all the HTML in the email. I'm using Rails 2.3.8. I read about this monkey patch here... but it seemed to indicate a newer version of rails had over come this? And I don't really wanna monkey patch if I can avoid one. Rails -