-
I am getting the above exception after successfully subscribing a user to a monthly plan, in development. This is my mailer and I am clearly passing the from address class PlanSubscriptionMailer < ApplicationMailer
def successful_subscription
@user = User.find_by(email: params[:user_email])
mail(
from: "email@email",
to: email_address_with_name(@user.email, @user.full_name),
subject: "HP: Successful subscription!"
)
end
end {"context":"Job raised exception","job":{"retry":true,"queue":"default","wrapped":"ActionMailer::MailDeliveryJob","args":[{"job_class":"ActionMailer::MailDeliveryJob","job_id":"8f37998d-9597-4965-bfbc-369befd320c4","provider_job_id":null,"queue_name":"default","priority":null,"arguments":["Pay::UserMailer","receipt","deliver_now",{"params":{"pay_customer":{"_aj_globalid":"gid://headportfolio/Pay::Customer/6"},"pay_charge":{"_aj_globalid":"gid://headportfolio/Pay::Charge/13"},"_aj_symbol_keys":["pay_customer","pay_charge"]},"args":[],"_aj_ruby2_keywords":["params","args"]}],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2023-10-26T10:11:38.662168000Z","scheduled_at":null}],"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","jid":"3d885d055a3b3113d1feb033","created_at":1698315098.662215,"enqueued_at":1698315214.7628329,"error_message":"SMTP From address may not be blank","error_class":"ArgumentError","failed_at":1698315099.602443,"retry_count":2,"retried_at":1698315162.652777}} The stack trace point to the letter opener gem I am using on dev
Other emails are being set well and show correctly on dev via the letter opener gem. Do pay gem emails not work well with Letter opener? (haven't tested on production yet) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
I think the email address is set in the |
Beta Was this translation helpful? Give feedback.
-
You will want to set a default from address in your ApplicationMailer, or use the |
Beta Was this translation helpful? Give feedback.
-
Thanks @deanpcmad ! @excid3 I had to set the I already had a |
Beta Was this translation helpful? Give feedback.
I think the email address is set in the
pay.rb
initializer file as thesupport_email
- https://github.com/pay-rails/pay/blob/main/docs/2_configuration.md#configuration