actionmailer

Send to multiple recipients in Rails with ActionMailer

孤者浪人 提交于 2019-11-27 11:27:44
问题 I'm trying to send multiple emails based on a boolean value in my database. The app is a simple scheduling app and user can mark their shift as "replacement_needed" and this should send out emails to all the users who've requested to receive these emails. Trouble is, it only every seems to send to one email. Here's my current code: def request_replacement(shift) @shift = shift @user = shift.user @recipients = User.where(:replacement_emails => true).all @url = root_url @recipients.each do |r|

image_tag in mailer not using asset_host

て烟熏妆下的殇ゞ 提交于 2019-11-27 11:25:09
问题 image_tag isn't using the asset_host I've set. Any ideas why? The only thing I can think of is it having to do with it being a Mailer. config/environment/development.rb config.action_controller.asset_host = "http://localhost:3000" myMailer.rb <%= image_tag "logo.png", :style=>"margin-left:10px; padding-bottom:15px;" %> rendered as: <img alt="Logo" src="/images/logo.png?1303090162" style="margin-left:10px; padding-bottom:15px;" /> In console: > MyApp::Application.config.action_controller #

Rails ActionMailer with multiple SMTP servers

两盒软妹~` 提交于 2019-11-27 10:49:00
问题 I have a need to use two different smtp servers in a Rails application. It appears that the way ActionMailer is constructed, it is not possible to have different smtp_settings for a subclass. I could reload the smtp settings for each mailer class whenever a message is being sent, but that messes up the ExceptionNotifier plugin which is outside my control (unless I mess with it too). Does anyone have a solution/plugin for something like this? Ideally I would like to have class UserMailer <

Sending mail with devise and Gmail smtp server

假如想象 提交于 2019-11-27 09:42:26
问题 I am using Devise :confirmable and :recoverable module to confirm a user and to let him recover his password if he forgets it. Everything is going fine, the mail gets generated and I can see it in the server log, but then I am facing errors and the mail is not delivered to the mailbox. The SMTP settings for my environment.rb file is : require 'tlsmail' Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.perform_deliveries = true

actionmailer “from” setting

谁都会走 提交于 2019-11-27 07:11:41
问题 I am using ActionMailer and in my mailer model, I have a from set like this default :from => "from@example.org" In my environment.rb, I have a different username within ActionMailer::Base.smtp_settings = {} but I'd like the from address to override this.. so that the user sees only that. Is this possible? Additionally, when I change my settings within environment.rb, I don't see my changes take place... do I need to restart my rails server to refresh these settings? === here are some of my

Rails Mailer “Net::OpenTimeout: execution expired” Exception on production server only

耗尽温柔 提交于 2019-11-27 05:39:05
问题 I am using Ruby MRI 2.0.0 and Rails 3.2.12 on a Ubuntu 12.04 TLS VPS and attempting to setup email notifications in my app. It was working fine a few days ago, but not anymore. My web host is OVH. My SMTP settings: config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :user_name => 'sender@gmail.com', :password => 'secret', :authentication => 'plain', :enable_starttls

Sendgrid / email sending issues in Ruby on Rails (hosted on Heroku)

落花浮王杯 提交于 2019-11-27 05:29:42
问题 im having a problem getting sendgrid to send emails successfully on a rails 3.1 app that's using authlogic for authentication and is being deployed on heroku. i have the following action mailer configuration on config/environments/[development.rb and production.rb]: config.action_mailer.delivery_method = :smtp config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.default_charset = "utf-8" config.action_mailer.raise_delivery_errors = true config.action

Setting up a Gmail Account to work with ActionMailer in Rails 3

风流意气都作罢 提交于 2019-11-27 05:08:06
问题 I have a contact page form that is setup to send an email to a Gmail account. Only problem is it won't send. I believe I have narrowed the error down to my settings inside of the initializers directory. These are my current settings for trying to setup a standard gmail account to send mail: Could it be that my domain setting is wrong or should I be typing in myemail@gmail.com for :user_name ? This is the first time I have used ActionMailer so I don't really know what I am doing. Can somebody

gmail smtp with rails 3

蓝咒 提交于 2019-11-27 04:20:17
问题 I am trying to get a confirmation email sending using a gmail account. I have looked around and there is nothing that is obvious. There is no errors or anything, it just dosn't send I have this as the initalizer: ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "gmail.com", :user_name => "<address>@gmail.com",

Rails 3 ActionMailer and Wicked_PDF

那年仲夏 提交于 2019-11-27 01:24:21
问题 I'm trying to generate emails with rendered PDF attachements using ActionMailer and wicked_pdf. On my site, I'm using already both wicked_pdf and actionmailer separately. I can use wicked_pdf to serve up a pdf in the web app, and can use ActionMailer to send mail, but I'm having trouble attaching rendered pdf content to an ActionMailer (edited for content): class UserMailer < ActionMailer::Base default :from => "webadmin@mydomain.com" def generate_pdf(invoice) render :pdf => "test.pdf",