Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:53:22+00:00 2026-05-25T21:53:22+00:00

in my app, DJ fires off a an email but for some reason I

  • 0

in my app, DJ fires off a an email but for some reason I see the email in the log file twice though it is sent only once? I confirmed in the logs that DJ runs only once and user_mailer runs only once. So why do I see the email twice in the log file? What is Rails doing?

Rendered user_mailer/room_notification.text.erb (0.9ms)

Sent mail to rachela.xxxxxxx@gmail.com (1097ms)
Date: Fri, 30 Sep 2011 13:34:56 -0700
From: "roomxcom" <no-reply@roomxcom>
To: rachela.xxxxxxx@gmail.com
Message-ID: <123@-MacBook-Pro.local.mail>
Subject: [Email Testing] Test 12
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

AAAAA Did something:

Test 12

http://localhost:3000/c19

Sent mail to rachela.xxxxxxx@gmail.com (3510ms)
Date: Fri, 30 Sep 2011 13:34:56 -0700
From: "roomxcom" <no-reply@roomxcom>
To: rachela.xxxxxxx@gmail.com
Message-ID: <123@-MacBook-Pro.local.mail>
Subject: [Email Testing] Test 12
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

AAAAA Did something:

Test 12

http://localhost:3000/c19
  SQL (0.1ms)  BEGIN
  AREL (0.3ms)  DELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = 25
  SQL (0.4ms)  COMMIT

Delayed Job:

UserMailer.delay.room_notification(room, record.user, room_member.user, record.item)

User Mailer:

def room_notification(room, user_creator, user_recipient, item)
  ...
mail( :from => "XXXX <no-reply@XXXXXXXXXX.com>",
      :to => user_recipient.email,
      :subject => "[#{@room.title}] #{@item.title}"
    ).deliver

Any idea what’ going on and why rails is showing the email in the log twice? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:53:23+00:00Added an answer on May 25, 2026 at 9:53 pm

    edit: Here’s a clearer explanation now that it’s daytime and I’ve had some coffee…

    This line is adding the message to the queue:

    UserMailer.delay.room_notification(room, record.user, room_member.user, record.item)
    

    So Delayed_job then calls the room_notification method in UserMailer to send the mail:

    def room_notification(room, user_creator, user_recipient, item)
      # ...
      mail(:from => "XXXX <no-reply@XXXXXXXXXX.com>",
           :to => user_recipient.email,
           :subject => "[#{@room.title}] #{@item.title}"
      ).deliver
    end
    

    This would be enough in itself to send the mail but you also have a redundant .deliver on the end of the mail method so it’s sending it twice.

    TL;DR Remove .deliver from mail(...) in the room_notification method and everything should be fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an app that fires off https requests to a 3rd party service
I am having trouble loading .swf files to my flash app off my cloudstorage
my app does something when the screen goes black, but I want it to
I am writing a program that fires off an intent to start a service
I have a web app that spawns off a script that runs a Nutch
So I have a sliding door style animation that as of now fires off
C# 3.5 Winforms app. I have a timer that fires every 30 seconds on
Our Mac cocos2d app (http://deepworldgame.com) has been randomly throwing TSMProcessRawKeyCode failed exceptions for some
I have an app that needs to display some PDF files. The files are
This is a bit complicated but here goes. I have a Rails app that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.