ruby on rails - Invitation email doesn't have a From: value -


when invite user, email inviation link gets sent successfully. however, email has no from: value, mail server returns error because (rightfully) refuses send email without from value.

so need set value somewhere, don't know , how? both devise , devise_invitable not create usermailer or invitationmailer object. invite method:

  def invite     user = user.find(params[:user_id])     user.update_attributes(invitation_created_at: datetime.now)     user.deliver_invitation      redirect_to users_path, notice: i18n.t("user.messages.invited")   end 

how can make sure from value gets filled?

for devise add email address config/initializers/devise.rb

config.mailer_sender = 'me <noreply@me.com>' 

for actionmailer add config environment config file, e.g. config/environments/production.rb

actionmailer::base.default :from => 'me <noreply@me.com>' 

you can overwrite these on per mailer basis:

class examplemailer < actionmailer::base   default from: "me <ceo@me.com>" 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -