Questions tagged [actionmailer]
Action Mailer is a framework for designing email service layers. Original ActionMailer is written in Ruby, but there is also implementation for ASP.NET MVC.
2,352
questions
1
vote
2
answers
40
views
Testing ActionMailer with both paramaters and arguments
How do you test a mailer method that uses both params and arguments.
class UserMailer < ActionMailer::Base
def invoice(invoice)
@user = params[:user]
...
end
end
None of these ...
0
votes
0
answers
19
views
How to assign specific mailbox for each user in Rails using ActionMailBox?
I am creating a service in which services can upload files from different methods.
One of them is by sending the file to a specific email address that is linked to the app.
I have managed to do so ...
0
votes
0
answers
40
views
Sidekiq is queueing mails in the 'default' queue instead of 'mailers' queue
While upgrading my Rails 6.0 application to Rails 7.0.3, I'm facing the following problem :
Sidekiq is enqueueing all my mailer jobs through the default queue instead of the mailers queue like it used ...
1
vote
0
answers
30
views
How to preview email using AWS SES (aws-sdk-ses) in Rails application
I am working on Ruby on Rails applications. We choose the AWS SES service to send emails to our users. We are using the aws-sdk-ses gem for this purpose.
And I'm faced with a problem with previewing ...
0
votes
1
answer
76
views
how to send email to user after purchase on STRIPE with ruby on rails
I would like to know how to send an email to the user after successful checkout
My Webhook controller:
class WebhooksController < ApplicationController
skip_before_action :...
0
votes
2
answers
53
views
NoMethodError (undefined method `timeout' for #<Net::SMTP smtp.gmail.com:587 started=false>):
Rails 7
not recieving email from action mailer. it forms the email then i get an error 500
saying no method timeout for #<Net::SMTP smtp.gmail.com:587 started=false>
i have spent a few hours on ...
0
votes
1
answer
51
views
Rails: How to configure the logger for the Rails Action Mailer
I would like to set up the logger option of the Rails Action Mailer, but the only info I found are these lines over at ruby on rails guides Action Mailer Configuration
logger: Generates information ...
0
votes
0
answers
74
views
Action Mailer, production mode, heroku and gmail
Action Mailer works for my app in development mode but not in production mode. I have pulled together a few possible solutions, none of which work for me.
production.rb:
require "active_support/...
0
votes
1
answer
50
views
Action Mailer not working, cannot figure out why
I am trying to use Action Mailer for the first time and am a student.
I set up AM weeks ago on a project but did not think it was working. Today, I went into the email account attached to AM and saw ...
0
votes
1
answer
159
views
After upgrading Rails from 6.1.1 to 7.0.3 my Devise mailers can't be initialized
I started upgrading my application from Rails 6.1.1 to 7.0.3. While doing this I also had to upgrade Devise from 4.7.3 to 4.8.1.
With old setup everything worked fine. Now after upgrading I can't ...
0
votes
0
answers
32
views
Mail_form gem not showing error for invalid email
I have working mail_form contact form with google's smtp service.
I satisfied almost with everything, but form not showing errors for invalid email.
There is an error appears if email field is blank, ...
1
vote
1
answer
53
views
Rails mail_form, can't send attachment
**
update
when I set = f.file_field to multiple: true I am not able to send attachment.
If file_field is set to sent just one file - it works!. In strong parameters I have:
params.require(:contact)....
0
votes
1
answer
62
views
Rails Action Mailer async ECONNREFUSED localhost:25
I am testing out Action Mailer for the first time, attempting to configure a User Welcome email upon signup. I understand that an email will not actually be send in development mode, but the logs seem ...
2
votes
0
answers
127
views
How do I create an email preview for SendGrid dynamic template Ruby on Rails
I'm new to using SendGrid with Ruby on Rails. I'm using SendGrid's dynamic template and the sendgrid_actionmailer gem to send emails.
I cannot figure out a way to show previews for these emails (...
0
votes
0
answers
97
views
ActionMailer: How to test a mailer with parameters
I have a mailer looking like this:
class HelperMailer < ApplicationMailer
def reset_password(helper:)
@to = helper
@reset_password_token = params[:token]
mail_custom
mail(to: @to....
0
votes
0
answers
16
views
Wicked_pdf keeps on rendering in the backend without showing anything in mail
I have a mailer in which I am trying to generate PDF and then send it as an attachment:
Here's my mailers/invoice_mailer.rb:
def invoice
@invoice = params[:invoice]
recipients = params[:...
0
votes
1
answer
36
views
Can i send and receive emails using ActionMailer in development env.?
I am trying to design a email confirmation but not able to receive emails in my gmail account. Can anyone help ?
0
votes
0
answers
48
views
Rails 7 send mail in production returns mail.delivery_method error undefined method `merge'
When I try to send any mail in production I get the following error.
gems/actionmailer-7.0.2.3/lib/action_mailer/delivery_methods.rb:65:in `wrap_delivery_behavior': undefined method `merge' for "...
0
votes
0
answers
18
views
rails - send different attachment's to different recipient's in action mailer
Let's say i've a multiple csv files say csv_1, csv_2. now i want to send these 2 files to different users (user_1, user_2(both get csv_1), user_3(get csv_2)) in 1 action mailer call.. is it possible?
...
0
votes
1
answer
293
views
Rails 7, ActiveMailer smtp is not setting up
I have this in config/development.rb
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { host: 'localhost:...
0
votes
0
answers
71
views
How to use Heya email campaigns with GoodJob instead of Sidekiq
I'm trying to send email campaigns in a rails app with the Heya gem and GoodJob. The example in the Heya readme as well as the Heya example app uses Sidekiq as the Active Job backend.
I'm confused ...
1
vote
1
answer
191
views
Why isn't a self signed SMTP Certificate ignored by Rails ActionMailer 6.1 / Ruby 3.0?
I can't get Rails ActionMailer 6.1 (with Ruby 3.0) to connect to an SMTP Mailer with a self-signed certificate.
All options that could possibly either use no TLS/SSL at all or to not verify the cert ...
0
votes
0
answers
17
views
Getting a 404 on a redirect from a button in an email
I'm using rails to send an email to log in a user through a link. In that email I have a button and link that both use the same url but with the button I'm getting a 404 error while using google or ...
0
votes
0
answers
26
views
Rake task will not send Email
I am setting up a rake task, so I can run it through heroku scheduler when it is in production.
The email sends when I run TaskMailer.task_overdue.deliver_later elsewhere, and I can see from what is ...
0
votes
0
answers
47
views
Rails action mailer - wrong number of arguments
I'm working on building my mailer and am getting the Error:
ArgumentError (wrong number of arguments (given 0, expected 1)):
app/mailers/blog_mailer.rb:2:in `blog_created'
I have passed the blog ...
0
votes
0
answers
31
views
rails - can't send email to real domain
i'm trying add action mailer to my rails project but i can't send mails to my gmail account but mails is actually appearing in the rails console.
application mailer.erb
class ApplicationMailer < ...
0
votes
0
answers
56
views
NoMethodError: undefined method `updated_settings' for #<ActionMailer::Parameterized::Mailer:0x00005635bdaaa9d0>
I am trying to send an email while using noticed gem version 1.4.1
This is my notification class
class Freelancer::UpdatePayoutSetting < Noticed::Base
# Add your delivery methods
deliver_by :...
0
votes
1
answer
29
views
using linebreak in action mailer on the @body
i have build some website that take a message and send it to email recipient,
the user can send emails by typing the message and the recipient.
my issue is when a user type :
"My \r\n name \r\n ...
1
vote
1
answer
200
views
Rails ActionMailer mail's always go to spam
I configured mailing as below:
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
domain: 'gmail.com',
port: 587,
user_name: ENV['EMAIL_USERNAME'],
password: ENV['...
0
votes
1
answer
33
views
Testing CSS fallback for linear-gradient with Rails Mailer Previews / Letter Openeer
I'm trying to get a fallback background-colour working for our Email template below:-
<a href="/" style="
background-image: linear-gradient(134.72deg, #3023AE 0%, #C86DD7 100%)&...
0
votes
0
answers
14
views
Rails Devise - how to customize mailer for user to set password [duplicate]
I want a new user (created by a client, not that this matters) to be emailed a Devise reset_password_instructions email in order to SET their password.
So far, I have looked into overriding the ...
1
vote
0
answers
274
views
Email CSS not applied in production. Premailer-rails with TailwindCSS on Heroku
Background
Tailwind is set-up using the cssbundling-rails gem which bundles all CSS into a single file: app/assets/builds/application.tailwind.css.
In dev env, emails are correctly rendered as ...
0
votes
0
answers
40
views
ActionMailer::Base::NullMail when call helper method from mailer class method
Let's assume I have a cats_helper at apps/helpers with the following definition:
module CatsHelper
def meow
'meeooww'
end
end
And a pets_mailer at app/mailers with the following definition:
...
0
votes
0
answers
10
views
How to add a method to ActionMailer::MessageDelivery so deliver_now works for development and deliver_later for production
When I am in development environment I don't wanna use the deliver_later method to my mailers cause I'm not using Redis there, so right now I have a send method in every mailer in my code.
E.g.
...
0
votes
1
answer
55
views
ActionMailer::Base.mail method is 'Not available' when called from initializer
I'd like to create a handler that rescues emails (mostly from timeout errors), so I can try to resend them later.
Others suggested that an initializer with ActionMailer::DeliveryJob.rescue_from ...
-1
votes
1
answer
104
views
Sending newsletters with SendGrid and Rails - What is the best approach?
I have a rails app with sendgrid API setup and I can send transactional emails just fine. Now I want to be able to send newsletters but I'm a bit confused about the flow and how to keep track of which ...
1
vote
0
answers
118
views
Rails sending Email with Postmark with message stream configuration
I am sending some email messages using the Postmark API with the postmark gem.
gem 'postmark-rails'
I want the messages to use a specific Message Stream. I am trying to do it using the action mailer ...
0
votes
2
answers
190
views
Mailer method returns unexpected ActionMailer::Base::NullMail
I am new to Rubyand also not good at OOP. I have a class like this
class Workflow::Mailer < ActionMailer::Base
def unapproved_remind_mail(args)
return [
{
&...
1
vote
2
answers
264
views
Override Devise Invitable `invite!` method in order to add attachment to invitation email - Rails
I have devise_invitable gem and an invitations controller InvitationsController < Devise::InvitationsController. I invite my user with this method User.invite!(user, inviter) from the gem.
Now, I ...
0
votes
0
answers
189
views
Rails Action Mailer works locally but not in Production: Heroku: Internal Server Error
I'm working on a project (Rails backend, React frontend) where I would like the user to receive an email when they register an account. I set up action-mailer with Gmail locally and it works fine ...
0
votes
0
answers
12
views
Rails ActionMailer::Base.mail message-id needs fixing
A rails 6.1 application on a Ubuntu 20.04 VPS which has postfix installed is failing when both testing
ActionMailer::Base.mail(
from: "test@mail.com",
to: "valid.recipient@domain....
0
votes
0
answers
133
views
Rails Action Mailer attachment inside mail method
I have a file which is not inherited from ActionMailer::Base. This file actually in a private gem. I can send email without attachment with ActionMailer::Base.mail(from:..., to:..., subject:.., body:.....
2
votes
1
answer
357
views
Rails DeliveryJob deprecation warning: How to upgrade to MailDeliveryJob?
I have a controller action that enqueues the delivery of an email. I wrote a test for that controller action and I've been getting a deprecation warning when I run the tests:
DEPRECATION WARNING: ...
1
vote
2
answers
33
views
Will I run into problems if temporarily removing Uniqueness on Emails?
So I'm currently messing around with ActionMailer / SendGrid for the first time, trying to configure some emails being sent out from the app. It's all working ok so far, but the problem is that in my ...
1
vote
2
answers
184
views
How to test instance variables in an ActionMailer object?
There is a before_action callback method in my ActionMailer object which is responsible for setting some instance variables.
class TestMailer < ApplicationMailer
before_action :set_params
...
0
votes
1
answer
46
views
How to set header_cookies in rspec mailers
In my mailers I generate pdf file for attachments, using header_cookies (pass it from controller). How do I generate header_cookies in the articles_spec.rb test ?
Article Mailer:
class ArticlesMailer &...
0
votes
0
answers
223
views
Action Mailer in Ruby on Rails framework does not send emails
I started studying Ruby on Rails.
To be familiar with Action Mailer I followed the guide on https://edgeguides.rubyonrails.org/action_mailer_basics.html.
What I did were
First, created the UserMailer ...
1
vote
2
answers
592
views
In Rails 6, how ensure a Mailer will not retry, eg, how add ActiveJob retry: false setting when Active job is used implicitly (not explicitly)?
In a new Rails 6.1 app, I want to explicitly disable any retries for mail jobs.
Since ActionMailer automatically uses ActiveJob, how can I add custom ActiveJob configuration for a specific mailer ...
0
votes
1
answer
27
views
How to call ApplicationRecord in ApplicationMailer on RAILS?
good day!
I have an application mailer and I want to call the application record to put it on the mailer. Is it possible to do this?
class UserMailer < ApplicationMailer
def verification_email
...
2
votes
1
answer
2k
views
OpenSSL::SSL::SSLError (SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello)
When I try sending an email using Actionmailer, I get the following error...
OpenSSL::SSL::SSLError (SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello)
My system is OS X 10.13....