actionmailer

Sending mails automatically through action mailer Rails 3.1

女生的网名这么多〃 提交于 2019-12-04 19:37:53
I have to send weekly emails to all the user about the latest things happening. I am using ActionMailer to accomplish other mailing task however I have no clue how to automate the weekly emails. Update I found whenever gem which could be used to schedule cron jobs. I guess this could be used to send weekly emails which I intend to. Still looking how to make it work with ActionMailer will update once I find the solution Update 2 This is what I have done so far using whenever gem:- in schedule.rb every 1.minute do runner "User.weekly_update", :environment => 'development' end in users_mailer.rb

How do I send signed emails from ActionMailer?

夙愿已清 提交于 2019-12-04 16:58:14
I'm using GMail as my SMTP server. I have that configuration working just fine: # config/initializers/action_mailer.rb: ActionMailer::Base.smtp_settings = { :tls => true, :address => "smtp.gmail.com", :port => "587", :domain => "www.example.org", :authentication => :login, :user_name => "admin@example.org", :password => "it's a secret" } I also have a public/private RSA key pair in config/ssl/rsa.public and config/ssl/rsa.private . What do I do to sign the emails before shipping them off to GMail's SMTP server? I think you want ActionmailerX509 . You need a certificate which you can a) buy for

ActionMailer and development mode, can it write to a file or something?

懵懂的女人 提交于 2019-12-04 15:38:54
问题 I want to test my registration process locally (development mode), how can I test how emails will be sent out and rendered etc? I am not referring to a unit-test or integration test, but just while developing my app and going on the register page etc. I want it to send out the emails but to a file not using smtp. Is this possible? What options do I have? 回答1: This is configurable in the config/environments/*.rb files. # output to tmp/mails directory config.action_mailer.delivery_method =

SASL LOGIN authentication failed: Invalid authentication mechanism on Rails using Postfix and Dovecot on Ubuntu 12.10 [closed]

大城市里の小女人 提交于 2019-12-04 15:02:08
I have configured an ubuntu 12.10 server with Postfix and Dovecot. Nonetheless, I have SASL Login authentication problem when I try to send emails using a rails web application. Using RoundCube Webmail, I get this log when I send an email: Feb 21 21:09:01 ks400054 postfix/qmgr[17883]: 61D4E113: removed Feb 21 21:16:34 ks400054 postfix/smtpd[19157]: connect from ks400054.kimsufi.com[37.59.38.218] Feb 21 21:16:34 ks400054 postfix/smtpd[19157]: 9FA8419: client=ks400054.kimsufi.com[37.59.38.218], sasl_method=CRAM-MD5, sasl_username=noreply@stagingcrio.info Feb 21 21:16:34 ks400054 postfix/cleanup

How to intercept ActionMailer's messages on rails 3?

空扰寡人 提交于 2019-12-04 12:00:00
I'm trying to intercept messages in my rails (3.0.10) app to modify the body. While I was able to find some info about how to do that, it seems something has changed and now using the old methods no longer work. I use a code that looks like this: class Hook def self.delivering_email(message) message.subject = 'Hook changed the subject' end end ActionMailer::Base.register_interceptor(Hook) After sending an email, the subject doesn't get changed! I also found a tweet that indicates that interceptors are not called when using the deliver method on messages, but the premailer-rails3 gem uses the

Sidekiq and rails 4 actionmailer never delivers emails

人盡茶涼 提交于 2019-12-04 09:15:35
问题 I've setup sidekiq in a rails 4 application for sending emails and processing background jobs. I have also devise which I am using devise_async and a typical contact form emailer. I am using gmail for sending emails. If I remove sidekiq, it sends the emails normally through gmail (both devise and contact form) but when I am enabling it, it doesn't work (neither devise_async neither contact form). Sidekiq shows that the background jobs starts and finishes successfully (I also see them through

Render Different View (template) for ActionMailer

非 Y 不嫁゛ 提交于 2019-12-04 09:06:00
问题 I'm trying to do a conditional render of a different template from ActionMailer (Rails 3.1.1). I want most users to get the normal welcome.html.erb template, but some users to get the special welcome_photographer.html.erb template. This type of thing works in ActionController: # (in /app/mailers/user_mailer.rb) def welcome(user) @user = user mail(:to => "#{@user.name} <#{@user.email}>", :subject => "Welcome to ...") render "welcome_photographer" if @user.is_photographer end But the render

How can I send mail with rails without a template?

夙愿已清 提交于 2019-12-04 07:55:43
问题 In my Rails 3 project, I want to send some simple notification emails. I don't need to make a template for them or do any logic. I just want to fire them off from various places in the system. If I were doing this in an arbitrary ruby script I would use pony. However, I'd like to still use the rails mail facilities and configuration, so that I get the same reliability and setup that I have for the rest of the mail in my system. What's the most simple way to do this? Ideally there would be

How to install Refinery CMS using Rails 4

百般思念 提交于 2019-12-04 07:17:04
I previously never had a problem with Refinery. I was refreshing my knowledge by following along to the tutorial http://railscasts.com/episodes/332-refinery-cms-basics .Then when I created a new app with Refinery CMS, I got this error Bundler could not find compatible versions for gem "actionmailer": In Gemfile: refinerycms (~> 2.1.0) ruby depends on actionmailer (< 3.3, >= 3.1.3) ruby rails (= 4.0.0) ruby depends on actionmailer (4.0.0) But should not these things be there by default with the CMS? why would there be errors only now? Ben Well, my five cents are that Refinery is not yet

why is authentication: 'plain' the default setting for actionmailer in rails (with gmail smtp)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 06:48:09
I am reading up on actionmailer for rails. My question is about the default settings as described here : config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => 'baci.lindsaar.net', :user_name => '<username>', :password => '<password>', :authentication => 'plain', :enable_starttls_auto => true } now reading from the API here it says that: ":authentication - If your mail server requires authentication, you need to specify the authentication type here. This is a symbol and one of :plain (will send the password in