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,386
questions
0
votes
2
answers
64
views
Rails 7 is trying to use .deliver instead of deliver_now
I have this class to send an mail, using rails 7
class Mailer < ApplicationMailer
def initialize(emails)
super()
@emails = emails
end
def send()
mail(
to: @emails,
...
1
vote
1
answer
20
views
How to include urls when evoking ActionMailer::Base.mail
I am sending an email with Rails like so:
ActionMailer::Base.mail(
from: "[email protected]",
to: "[email protected]",
subject: "test",
body: "test"
)....
0
votes
0
answers
12
views
SSL issue when using custom domain as host for ActionMailer urls
My Rails App runs on Heroku. We registered a custom domain with GoDaddy, but let our SSL be handled automatically by Heroku.
The bug occurs in the mailing process. In my production.rbfile, I assigned ...
0
votes
1
answer
33
views
Rails ActionView::MissingTemplate, Template Is Missing for mailer
I have a mailer class called ContactUsMailer that inherits from ActionMailer::Base.
class ContactUsMailer < ActionMailer::Base
default from: 'myema[email protected]'
def contact_us(name:, email:, ...
0
votes
1
answer
42
views
"Inline Attachments" images are not shown in mail with Action Mailer
Regards!
I'm trying to put Attachments Inline images into an Gmail email, but for some reason, images are not shown in the email's body.
I have searched a lot on the Internet and all found answers say ...
0
votes
1
answer
31
views
Why won't Rails' with_locale method allow additional URL parameters?
I've got this Mailer in my Rails 7 project:
# app/mailers/quote_mailer.rb
class QuoteMailer < ApplicationMailer
def quote_mail(quote)
@quote = quote
@user = quote.user
@client = ...
1
vote
2
answers
37
views
Hi. i'm trying to build a newsletter using action mailer. Unfortunately i'm stuck when i'm trying to send emails to each users registered
the preview isn't working and keep getting different errors.
My schema.rb looks like this
ActiveRecord::Schema[7.0].define(version: 2022_12_31_110010) do
create_table "users", force: :...
0
votes
0
answers
25
views
Option to show all headers for ActionMailer previews doesn't appear
I would like to see all of my headers in ActionMailer::Preview as described in this PR. I was not able to see them/make them appear in our company project, so I started a new project to reproduce the ...
0
votes
0
answers
18
views
Upgrade to rails 6.1.7.1 does not recognize the ActionMailer subclass in environments config
After upgrading our app from rails 5.2.8.1 to rails 6.1.7.1, the ActionMailer subclasses are not recognized in environments config.
This is the error we recieved: uninitialized constant BulkMailer (...
0
votes
1
answer
46
views
Is there any way to confirm email delivery by smtp at Action Mailer?
Action mailer sends email through sendgrid with smtp settings, I can get delivery confirmation by sengrid's webhook, and some emails delivered to sengrid, some - looks like not, for example we sent ...
2
votes
1
answer
88
views
Ruby on Rails update triggered ArgumentError in Mailer functions
We have recently migrated our codebase from Ruby 2.7.x and Rails 5.2.x to Ruby 3.2.2 and Rails 6.1.7.3. Previously, our mailers were defined like this:
class ApplicationMailer < ActionMailer::Base
....
2
votes
0
answers
43
views
Ruby on Rails SMTP Settings 550 Sender verify failed
When sending my e-mail I get
550 Sender verify failed (Net::SMTPFatalError)
This is what my smtp_setting looks like:
config.action_mailer.delivery_method = :smtp
config.action_mailer....
2
votes
1
answer
60
views
Ruby on Rails ActionMailer SMTP Settings mTLS
How would you setup a mTLS connection for action mailer in ruby on rails?
0
votes
1
answer
67
views
Testing mailers with Rspec and factory_bot
Hey guys, i need help, am new to testing and am testing my mailer but i do not understand y am getting this error when i run my tests.
'expected ActionMailer::Base.deliveries.size to have changed by 1,...
0
votes
0
answers
85
views
SocketError (getaddrinfo: Name or service not known) while sending email using Proton Mail in rails
I'm getting error while the mail is getting deliver. When I changed the configuration in development.rb from proton mail to gmail for testing purpose then the email is getting sent. Meaning there's a ...
1
vote
1
answer
32
views
NoMethodError when "to" contains a name with unparsable characters
We get people's names from a third party source, some of the last names contain a department suffix such as "(R&D)". When trying to send email, via ActionMailer, we get a NoMethodError ...
1
vote
0
answers
34
views
How to charge Wicked PDF stylesheets into ActionMailer in Rails
I am using the wicked PDF gem and to load the styles for my page it works like a charm, it loads the styles and the content
The problem is when I want to attach a pdf in Mailer, the ...
0
votes
1
answer
146
views
Rails : how send an email at a specific date with Rails 7?
I have already read this thread (Send emails at specific times in Rails) which looks interesting but was written 8 years ago.
Here is my need :
I need to send an email at a specific date (a user ...
1
vote
1
answer
48
views
ActionMailer::Preview callbacks?
ActionMailer::Base provides call backs like ActionController::Base does which allows for common code to be called before a mailer function/action. It seems this is not supported for ActionMailer::...
0
votes
0
answers
11
views
Why are links inside my ActionMailer views not following the default settings?
I have a bunch of ActionMailer emails that are causing some of our users to hit a "Unsafe website" error message in their browser.
In my production.rb I have this line
config.action_mailer....
0
votes
1
answer
93
views
ActionMailer SMTP working in production but not locally
Seems to be the opposite problem to a lot of the questions on here. I've not been able to get the mailers working locally but then I deployed my app to Heroku and everything is fine.
No apparent ...
0
votes
0
answers
115
views
Send email using html button javascript and Rails
Im new to using rails and i have a test where im given a code that send an email through a click and i have to compleate it,
Here is the code:
app/views/root/index.html.erb
<%= form_tag root_path, ...
0
votes
0
answers
28
views
Create custrom domain specific emails to send and receive emails in Rails 6+
I have a Rails6+ application, where I want the users to create custom emails that they can use to send and receive emails under my domain(mikesgh).For example users can create emails like anything@...
0
votes
0
answers
151
views
how to end email using Rails and js and html button?
Im new to using rails , and i am trying to figure out a solution to sending an email using an html button, javascript function and rails.
HTML and JS code:
<%= form_tag root_path, class: "send-...
0
votes
1
answer
109
views
ActionView is missing template in Preview. How to resolve?
I am currently trying to have ActionMailer send an email with Letter_Opener gem. When I try to view the preview with localhost:3000/mailer/order_mailer the terminal logs this error:
app/mailers/...
1
vote
0
answers
85
views
ActionMailer and Rspec: Unable to find a browser command (Rails 5.2)
I have upgraded rails 4.2.11.1 to 5.2.8.1, and ActionMailer stopped working within Rspec.
When I run this simple welcome email (described on their page):
UserMailer.with(user: @user).welcome_email....
0
votes
0
answers
73
views
Delete an email already queued through Action Mailer rails
Background: I have a job that runs every morning at 6am. This job itself either sends emails or queues emails. It depends on an appointment for a user. If an appointment is scheduled for that ...
0
votes
0
answers
109
views
Mailgun sending emails from sandbox in production
in my Mailgun settings I have 2 domains: sandbox and empresas.xxx.es.
In my production.rb file, I've got it configured as shown:
ActionMailer::Base.smtp_settings = {
:port => ENV['...
1
vote
2
answers
62
views
Rails Action Mailer Issue
Im trying to send HTML code as a variable using ActionMailer's ( Ruby on Rails default mailer ).
I have an example bellow with an easy variable ( thats also HTML code )
def newsletter // ==> my ...
2
votes
1
answer
95
views
ActionMailer with Rails: uninitialized constant UserMailer
Getting this error in console when I try UserMailer.welcome.deliver_now
(irb):6:in `<main>': uninitialized constant UserMailer (NameError)
UserMailer.welcome.deliver_now
^^^^^^^^^^
Did you mean?...
0
votes
1
answer
252
views
ActionMailer with Rails: Missing template user_mailer/welcome with "mailer"
I get this error in my console when I run UserMailer.welcome.deliver_now
irb(main):002:0> UserMailer.welcome.deliver_now
UserMailer#welcome: processed outbound mail in 0.7ms
/Users/jlandis/.rbenv/...
0
votes
0
answers
71
views
ActionMailer failed while using SMTP in production mode
Rails 7.0.1
I have tried and succeeded using ActionMailer in development environment, however it doesn't work in production environment. It seems that I am not able to receive the mail that I sent.
...
1
vote
0
answers
206
views
Rails ActionMailer 6.1 / Ruby 3.1.2 / docker : certificate verify failed (self signed certificate)
Could someone please help me to troubleshoot/configure sending email with ssl/tls please ?
Ruby : 3.1.2
Rails : 6.1.7
net-smtp: 0.3.3
docker image : 3.1-slim
My own organisation SMTP serveur that ...
0
votes
0
answers
24
views
Rails - image not rendering in mail
I'm Trying to attach an image in the ActionMailer... it rendering the image in the mailer preview but when i send to the actual server... the image is not rendering... when i inspect the path of the ...
0
votes
2
answers
742
views
Rails deliver_later getting Unsupported Argument Type
I have changed mail delivery in my Rails application to implement deliver_later instead of deliver_now, and am running into an error message from ActiveJob.
The old mechanism was:
mail_collection.each ...
0
votes
0
answers
107
views
Net::SMTPAuthenticationError: 535 5.7.139 The request did not meet the criteria to be authenticated successfully
I am trying to migrate my noreply mailer from Gmail to Office 365 but my SMTP setting is not working for Office 365. I already tried looking for solutions online like changing the SMTP auth from plain ...
0
votes
2
answers
49
views
Rake test equivalent for ActionMailer::TestHelper?
We have recently migrated from sending emails with deliver_now to deliver_later. So that queued emails aren't lost when the system restarts, we implement this with Sidekiq.
When we used deliver_now, ...
0
votes
0
answers
22
views
Trying to extend ActionMailer::MessageDelivery
I would like to extend the MessageDelivery class in the ActionMailer module and am not successful in my attempts.
From what I have read, it should be as simple as:
module ActionMailer
class ...
0
votes
1
answer
25
views
How to prevent Rails from rendering links when using partials in Mailer
I would like to reuse my partials in mailer layouts, but I want to avoid rendering the hyperlinks and instead print out just their name, like using link_to_if / link_to_unless methods.
Which condition ...
0
votes
0
answers
27
views
Seems like I can't bcc an email address with Roadie Rails gem
I am using Roadie Rails gem, and for some reason when I add bcc field as an argument to the mail method, it does not send the email to the bcc'ed user and the bcc'ed user ends up showing in the to ...
0
votes
0
answers
21
views
OUTLOOK SMTP - Mail not sending on production using rails [duplicate]
I have the below configuration on my development.rb and production.rb.
config.action_mailer.default_url_options = { host: ENV["HOST_NAME"] }
config.action_mailer.perform_deliveries = ...
0
votes
1
answer
55
views
Instance variables not appearing in Rails ActionMailer and rspec preview
I have a rails 7 app. Here are the relevant pieces of code:
/app/mailers/team_mailer.rb
def final_survey_nag_email
@leader_name = params[:leader_name]
@leader_email = params[:email]
@team_name = ...
0
votes
1
answer
76
views
How to pass dynamic scope params to Ruby on Rails Mailers?
In my Rails 7 app I have the following routes set up:
Rails.application.routes.draw do
scope 'account/:current_account' do
resources :clients
end
end
This will, for example, generate a ...
0
votes
1
answer
64
views
Change I change the order of Rails Preview Mailers?
I know this is probably an odd request, but I have an app that I am building (Rails 7) and it's very email heavy. When I visit the default mailer preview; in my case /rails/mailers/team, I'd like to ...
0
votes
0
answers
165
views
How can I truncate the HtmlBody when sending emails through postmark
I'm using postmark to send emails in my rails application where the email content is auto generated. The thing is that in some cases I getting this error from postmark.
Postmark::...
1
vote
2
answers
328
views
Sendgrid emails being sent without the template
My sendgrid emails are being sent ok, but the template is never loaded. I have tried multiple times with many templates but they are never called, so there must be something wrong with my call.
This ...
0
votes
1
answer
159
views
Multipart email with ical attachment displays incorrectly
I'm not sure if this is an issue with my code, ActionMailer, Mail, or maybe even the icalendar gem?
A user registers for an event and they get an email with an ical attachment:
# app/mailers/...
1
vote
1
answer
397
views
Actionmailer on Redmine outputs error "certificate verify failed (self signed certificate)" on email send
I updated a Bitnami Redmine package from version 4.2.1-0 to version 5.0.2-2.
I successfully migrated all data to the new server, but now the actionmailer doesn't work anymore.
When I try to send a ...
0
votes
1
answer
49
views
How can I use ActionMailer previews in a Sinatra app?
I have a Sinatra Ruby app with the ActionMailer gem for sending emails. The email sending functionality works fine, but I can't figure out how to use the preview functionality for development. My ...
0
votes
1
answer
220
views
Rails ActionMailer Quoted Printable Encoding breaks the output
I have this html message that I would like to send using MIME format through a rest api call ( using microsoft send email api ).
@message = "<meta http-equiv=\"Content-Type\" ...