actionmailer

undefined method `deliver_sent' for MailerFormError:Class

﹥>﹥吖頭↗ 提交于 2019-12-13 04:26:27
问题 I'm upgrading rais 2.3.2 project to rails 3 Error: undefined method `deliver_sent' for MailerFormError:Class Application Trace | Framework Trace | Full Trace app/controllers/leads_controller.rb:72:in `block in create' app/controllers/leads_controller.rb:56:in `create' MailerFormError is my model: class MailerFormError < ActionMailer::Base It's no method 'deliver_sent' in model and Actionmailer::Base too :( code with it in controller: @msg = {} @msg["errors"] = @lead.errors @msg["params"] =

Attaching an e-mail form to a controller

こ雲淡風輕ζ 提交于 2019-12-13 04:19:34
问题 I would like to change the below link into an form that posts params of the form to my controller to send an email... the current link works and sends an email... <%= button_to 'Hello', contact_pages_path, :method => :put %> In My controller I have: def contact Contact.contact_form.deliver end My Mailer: class Contact < ActionMailer::Base default from: "****" default to: "****" def contact_form mail(:subject => "Registered") end end and in my routes I have: resources :pages do put :contact,

Dynamic domain name in Rails action mailer while using sidekiq

最后都变了- 提交于 2019-12-13 00:43:50
问题 In my requirement ,there are different domain names for single project.I would like to send reset password link with a domain name where the user requested for the reset password.For that I have done the follows in application_controller.rb and it works well. before_filter :set_mailer_host def set_mailer_host ActionMailer::Base.default_url_options[:host] = request.host_with_port $url_host = request.host_with_port end Later,I have used sidekiq for delayed mailer and updated like follows on

Rails 3 ActionMailer corrupts attachments

百般思念 提交于 2019-12-12 21:58:08
问题 I'm using Rails 3.2.13 and have been following along with the ActionMailer guide (http://guides.rubyonrails.org/action_mailer_basics.html#sending-emails-with-attachments), but I'm having difficulty with sending email attachments. After execution the email sends properly but the attachment is always corrupted. In particular, I see the rendered email and the correct filename for the attachment but as a 1KB file that can't be opened. I've seen similar issues around stack overflow and elsewhere

mailer authentication error in Rails 3.2 with gmail or SendGrid

帅比萌擦擦* 提交于 2019-12-12 14:52:00
问题 I'm trying to set up mailing from a very simple Rails 3.2 app. Tried Gmail, tried SendGrid. Getting same error. Net::SMTPAuthenticationError in UsersController#create 530-5.5.1 Authentication Required Here's my section of environments/development.rb # Care if the mailer can't send config.action_mailer.raise_delivery_errors = true # Change mail delivery to either :smtp, :sendmail, :file, :test config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: "smtp

ActionMailer “Net::ReadTimeout” when using Delayed Job with Rackspace “emailsrvr.com”

安稳与你 提交于 2019-12-12 14:32:17
问题 Edit: I'm using Rails 3.2.17 and Ruby 2.0.0p0 I've been having some issues with ActionMailer timing out on sending mail; See ActionMailer Timing out After increasing the default Unicorn timeout to 2min (for testing) It completes in about 45 sec. I thought the best way to handle this would be to use Delayed Job , however, when DJ runs the deliver method it's timing out too. Stack trace below. Is DJ the right tool for the job? Do I need to increase the timeout for DJ (I thought that I had read

Using mail_to with a block (mail_to … do)

 ̄綄美尐妖づ 提交于 2019-12-12 13:13:08
问题 I would like to do the following to insert a styled mail_to : <%= mail_to @colleague.email do %> <span class="email" id="colleague_40"> Reply by Email </span> <% end %> The RoR docs aren't specific on the topic of mail_to blocks but the above code doesn't seem to work. Is there a way to do a block in conjunction with mail_to ? 回答1: <% mail_content = capture do %> <span class="email" id="colleague_40"> Reply by Email </span> <% end %> <%= mail_to @colleague.email, mail_content %> 来源: https:/

How to force the character encoding of HTML e-mails in Rails 3?

若如初见. 提交于 2019-12-12 13:12:48
问题 I'm using Rails 3.1 (3.1.1 RC1) and I have configured ActionMailer to use windows-1252 as default encoding. (External requirement) This works perfectly with plain text mails, but as soon as I send HTML mails the text is converted to UTF-8 again resulting in garbled text. Here's what I've done/found out. I configured the default encoding: ActionMailer::Base.default :charset => 'windows-1252' My .erb template is actually windows-1252 encoded. I added the required marker <%# encoding: windows

Rails 4.1 Force ActionMailer to return other value

拜拜、爱过 提交于 2019-12-12 12:35:36
问题 how to i can force to return another value in ActionMailer method. Example: class TestMailer < ActionMailer::Base extend MandrillApi def index(email, code) @code = code result = MandrillApi.send({subject: t('test.index.subject'), to: email, template: render_to_string}) return result end end In this case i use ActionMailer to render template(render_to_string) and pass variables to the view, but i need get result value from MandrillApi module. When i call the method TestMailer.index("xxxx@gmail

actionmailer encoding - rendering garbage in email client

走远了吗. 提交于 2019-12-12 09:39:00
问题 I have both text and html parts for my emails. Users are reporting 'garbage characters' in some cases where the email is include values from the db. It seems to be an issue when unicode characters are involved. I created trivial template that just echos back the value for both the text and html parts ( <%= @body_text %> ) and tested it out with a sample string: a permanent feature ë When I see this string in gmail it looks like: a permanent feature ������ Inspecting the header I see this on