diff --git a/app/controllers/emails_controller.rb b/app/controllers/emails_controller.rb index 95e19c7f..bb3e057b 100644 --- a/app/controllers/emails_controller.rb +++ b/app/controllers/emails_controller.rb @@ -6,7 +6,7 @@ class EmailsController < ApplicationController def create email = params[:email] - GenericMailer.delay.generic_mail(email[:from_email], email[:from_name], email[:message], email[:subject], email[:to_email], email[:to_name]) + GenericMailer.generic_mail(email[:from_email], email[:from_name], email[:message], email[:subject], email[:to_email], email[:to_name]).deliver_later render json: { notification: 'Email successfully sent' }, status: :created end end