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 4274758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:53:27+00:00 2026-05-21T07:53:27+00:00

I have a table of emails. And i need that Each user received email.

  • 0

I have a table of emails. And i need that Each user received email.

SO i made:

script/generate mailer Notifier

Next.

class Notifier < ActionMailer::Base
  def newgrants_notification(respondent)
     recipients user.email
     from       "lala@lala.com"
     subject    "Hi!"
     body       (:respondent => respondent)
  end
end

In app/views/notifier/newgrants_notification.erb
wrote : Hello!

and this my controller where i create question

@question = Question.create(:text => params[:question][:text], :security => rand(888).to_i)

if success = @question.save
  respondents = Respondent.find(:all)
  respondents.each do |res|
    Inquiry.create(:question_id=>@question.id.to_i, :respondent_id=>res.id.to_i)
    Notifier.newgrants_notification(respondents).deliver #this is right??
  end

what mistakes i did? messages aren’t coming ;(

  • 1 1 Answer
  • 1 View
  • 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-21T07:53:28+00:00Added an answer on May 21, 2026 at 7:53 am

    HI

    respondents.each do |res|
      Inquiry.create(:question_id=>@question.id.to_i, :respondent_id=>res.id.to_i)
      Notifier.newgrants_notification(res).deliver
    end
    

    When you are sending mail,the mail id is passed as a parameter so respondents is replaced with res.

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

Sidebar

Related Questions

I have a table that has duplicate email address, I need to insert just
I have an email subscription table and a user table. I need to combine
I have a table that stores email in 3 diffrent columns name host and
I have two tables user and email. One user can have multiple emails so
I have an order form (table) that I need to be sent to an
In my example I have a table where each row is a user for
I have a User class that has a UserProfile class. The email is stored
I have a table with email addresses (colums: id, email, user, date). I'm trying
I have a table of emails. The last record in there for an auto
I have a database that has a table email_eml that stores 3 attributes name_eml,

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.